接口联调出现问题总结

1、Request header field Content-Type is not allowed by Access-Control-Allow-Headers

在跨域请求时,可能出现以上问题,该问题是因为跨域请求包含自定义的header字段,而且会发现当前台有自定义字段时,总是会在发起请求前先发起一个options请求。

解决方法:后台运行跨域请求时,在Access-Control-Request-Headers 加上前台自定义的字段。

详情可参考:https://blog.csdn.net/xuedapeng/article/details/79076704

转载于:https://www.cnblogs.com/wenxuehai/p/10665903.html

你可能感兴趣的:(接口联调出现问题总结)