Authored by 孟顺

AFN 请求头添加 utf-8识别

review by 枪老板
... ... @@ -512,7 +512,7 @@ forHTTPHeaderField:(NSString *)field
mutableRequest.URL = [NSURL URLWithString:[[mutableRequest.URL absoluteString] stringByAppendingFormat:mutableRequest.URL.query ? @"&%@" : @"?%@", query]];
} else {
if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) {
[mutableRequest setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
[mutableRequest setValue:@"application/x-www-form-urlencoded; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
}
[mutableRequest setHTTPBody:[query dataUsingEncoding:self.stringEncoding]];
... ...
... ... @@ -235,7 +235,7 @@ NSDictionary *parameters = @{@"foo": @"bar", @"baz": @[@1, @2, @3]};
```
POST http://example.com/
Content-Type: application/x-www-form-urlencoded
Content-Type: application/x-www-form-urlencoded; charset=utf-8
foo=bar&baz[]=1&baz[]=2&baz[]=3
... ...