I am using AFNetworking make post request to server.If my response code is 400 then i am not able to print the json response.
This is my code
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
@"123", @"post_id",
arr_friendsTags, @"tagged_user", nil];
AFJSONRequestSerializer *requestSerializer = [AFJSONRequestSerializer serializer];
[requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
[requestSerializer setValue:api_key forHTTPHeaderField:@"Authorization"];
manager.requestSerializer = requestSerializer;
AFJSONResponseSerializer *responseSerializer = [AFJSONResponseSerializer serializer];
responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/json", @"text/javascript", @"text/html", nil];
manager.responseSerializer = responseSerializer;
[manager POST:url parameters:params success:^(AFHTTPRequestOperation *operation, id responseObject)
{
NSLog(@"JSON: %@", responseObject);
[self activityIndicator:@"hide"];
NSDictionary* json =responseObject;
} failure:^(AFHTTPRequestOperation *operation, NSError *error)
{
[self activityIndicator:@"hide"];
NSLog(@"Error: %@", error);
}];'