我想在AFNetworking中传递json字符串我正在使用下面的代码将数据解析到服务器。
我的JSON字符串:
{"Queries":[{"Field":"text_all","Value":"Class1","IsPhrase":false,"Near":0}],"Filter":[{"Key":"Test","Value":["Test","Test2"]}],"Paging":0,"Count":10}
代码:
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
manager.responseSerializer = [AFHTTPResponseSerializer serializer];
manager.requestSerializer = [AFJSONRequestSerializer serializer];
[manager POST:@“http://www.test.com” parameters:main_dict success:^(AFHTTPRequestOperation *operation, id responseObject)
{
NSLog(@"responseString: %@", json);
}
failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
}];