We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在使用 request 的时候需要修改 header 参数,结果发布到线上之后,发现请求 非 GET 请求接口都会报错 internet error,最开始以为是 服务端的 egg-security 的问题,各种改配置,加白名单加 origin,结果完全没有作用,然后在前端也加了很多 error handle 结果也是没有效果,完全没有想过是 content-type 的问题,去掉之后就正常了,所有类型接口都可以使用了。
request
import { request as baseRequest } from 'umi' export async function request<Response, Params = Record<string, unknown>>({ path, method = 'GET', params, data, }: IRequestOptions<Params>): Promise<Response | IResponseOptions<any> | never> { const obj = { ... headers: { 'Content-Type': 'application/json', }, ... } const res = await baseRequest(path, obj) return res }
The text was updated successfully, but these errors were encountered:
感谢小伙伴对本仓库项目的提问建议,我会尽快处理小伙伴的提问建议~ Thank you for your questions about the warehouse project. I will deal with your questions as soon as possible~
Sorry, something went wrong.
No branches or pull requests
在使用
request
的时候需要修改 header 参数,结果发布到线上之后,发现请求 非 GET 请求接口都会报错 internet error,最开始以为是 服务端的 egg-security 的问题,各种改配置,加白名单加 origin,结果完全没有作用,然后在前端也加了很多 error handle 结果也是没有效果,完全没有想过是 content-type 的问题,去掉之后就正常了,所有类型接口都可以使用了。The text was updated successfully, but these errors were encountered: