jkpang / PPNetworkHelper

AFNetworking 3.x 与YYCache封装
MIT License
1.58k stars 345 forks source link

无法设置请求头 #26

Closed ghost closed 7 years ago

ghost commented 7 years ago
[PPNetworkHelper setValue: forHTTPHeaderField:]不起作用

如果在af里 这样设置是可用的 AFHTTPRequestSerializer *requestSerializer = [AFJSONRequestSerializer serializer];

[requestSerializer setValue: forHTTPHeaderField:];

manager.requestSerializer = requestSerializer;

jkpang commented 7 years ago

[PPNetworkHelper setValue: forHTTPHeaderField:] 最终也是调用的 [_sessionManager.requestSerializer setValue: forHTTPHeaderField:];

你有没有先设置[PPNetworkHelper setRequestSerializer:PPRequestSerializerJSON]; 再调用[PPNetworkHelper setValue: forHTTPHeaderField:] 设置请求头呢 @iOSwxh