CodeGuru CodeGuru - 7 months ago 24
iOS Question

Pass NSArray as parameter in AFNetworking

How to pass NSArray as a parameter in AFNetworking?
API which i am trying to call is expecting a list(array).
I cannot use dictionary because their is no key.

 AFHTTPRequestOperationManager *manager;

 manager = [AFHTTPRequestOperationManager manager];
 manager.requestSerializer = [AFJSONRequestSerializer serializer];
[manager.requestSerializer setTimeoutInterval:500.0];
[manager POST:strRequestUrl parameters:yourArray success:^(AFHTTPRequestOperation *operation, id responseObject)

     NSString *msg;
     NSData *jsonData = [NSJSONSerialization dataWithJSONObject:responseObject
     NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];

 } failure:^(AFHTTPRequestOperation *operation, NSError *error) {