其他分享
首页 > 其他分享> > AFNetworking 学习笔记

AFNetworking 学习笔记

作者:互联网

看了下 AFNetWorking 的源码 发现是在不同的类中 设置不同的 Content-Type 这个暂时解读下, 具体的还要系统的阅读下

AFHTTPRequestSerializer : NSObject
[mutableRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];

AFStreamingMultipartFormData : NSObject
[self.request setValue:[NSString stringWithFormat:@"multipart/form-data; boundary=%@", self.boundary] forHTTPHeaderField:@"Content-Type"];

AFJSONRequestSerializer : AFHTTPRequestSerializer
[mutableRequest setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

AFPropertyListRequestSerializer : AFHTTPRequestSerializer
[mutableRequest setValue:@"application/x-plist" forHTTPHeaderField:@"Content-Type"];

标签:Content,setValue,笔记,学习,application,mutableRequest,forHTTPHeaderField,AFNetworkin
来源: https://blog.csdn.net/qq_27074387/article/details/90439126