近期在和合作方调试接口时一直报 Content type ‘application/octet-stream’ not supported,具体异常如下图:测试库是部署到华为云上的,当时在网上找了很久都没有解决,然而我本地测试和我用postMan连接测试服测试都不会出现这个问题,合作方用代码在本地测试也不会有问题,这时候我们定位到可能是nginx转发导致的问题,后来在网上找了下应该是合作方的nginx在转发请求时没有添加Content type导致,后来我在公司的nginx的location中添加 default_type application/json; 问题解决,意思就是如果请求没有设定类型,默认是json类型
location /api{
default_type application/json;
}

更多推荐

Content type ‘application/octet-stream‘ not supported