我试过下面的代码
AFHTTPClient *client = [[AFHTTPClient alloc] initWithBaseURL:[NSURL URLWithString:@"http://localhost:8080/"]];
[client setParameterEncoding:AFJSONParameterEncoding];
[client postPath:@"hello123" parameters:[NSDictionary dictionaryWithObjectsAndKeys:@"v1", @"k1", @"v2", @"k2", nil]
success:^(id object) {
NSLog(@"%@", object);
} failure:^(NSHTTPURLResponse *response, NSError *error) {
NSLog(@"%@", error);
}];
[client release];
在上面的代码中 [client setParameterEncoding:AFJSONParameterEncoding]; 这条线会做utf编码吗?