AFN设置HTTP请求头
Posted aRenOuBa
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了AFN设置HTTP请求头相关的知识,希望对你有一定的参考价值。
- AFHTTPRequestOperationManager*manager=[AFHTTPRequestOperationManagermanager];
- manager.securityPolicy=[AFSecurityPolicypolicyWithPinningMode:AFSSLPinningModeNone];
- manager.requestSerializer=[AFJSONRequestSerializerserializer];
- manager.responseSerializer=[AFJSONResponseSerializerserializer];
- [manager.requestSerializersetValue:@"application/json"forHTTPHeaderField:@"Accept"];
- [manager.requestSerializersetValue:@"application/json;charset=utf-8"forHTTPHeaderField:@"Content-Type"];
以上是关于AFN设置HTTP请求头的主要内容,如果未能解决你的问题,请参考以下文章