UseProtobufDemo icon indicating copy to clipboard operation
UseProtobufDemo copied to clipboard

添加 Content-Type 的需要

Open shangmaumau opened this issue 5 years ago • 1 comments

如果服务端要求 Content-Type 为 protobuf 的话,示例提供的这种请求方式,是不能成功的。我在一个日文博客里看到了这样的内容: 截屏2020-01-20上午9 41 32

所以后来在 mutableRequest 里面添加了这样的代码: [mRequest setValue:@"application/protobuf" forHTTPHeaderField:@"Content-Type"]; 就可以了。

shangmaumau avatar Jan 20 '20 01:01 shangmaumau

日文博客链接: https://qiita.com/KentaKudo/items/eb08026022a62a1f60cd 看是看不懂的,只不过大致能懂那意思。

shangmaumau avatar Jan 20 '20 01:01 shangmaumau