I added directories AFNetworking
and UIKit+AFNetworking
to project manager.
I use latest library 3.0.4
After I imported file AFNetwor
(void)postDatabyAF{
NSString *url;
NSDictionary *dict;
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
manager.responseSerializer = [AFJSONResponseSerializer serializer];
manager.responseSerializer = [AFJSONResponseSerializer serializerWithReadingOptions:
NSJSONReadingAllowFragments];
[manager POST:url parameters:dict success:^(AFHTTPRequestOperation * _Nonnull operation, id _Nonnull responseObject) {
NSLog(@" operation.responseData %@",operation.responseData);
NSLog(@" operation.response %@",operation.response);
NSLog(@"statusCode %ld",operation.response.statusCode);
} failure:^(AFHTTPRequestOperation * _Nullable operation, NSError * _Nonnull error) {
if (error) {
}
else{
}
}];
}