MKNetworkOperation * op = [self operationWithPath:@“thestore/services/storeservice.svc/getfavorites” params:fetchedObjects httpMethod:@“POST”];如何使用MKNetworkKit将NSArray传递到POST
fetechedObjects是一个数组。我可以通过数组循环得到我需要投入POST请求主体的价值观
[
{
"id": 9222,
"latitude": 19.7897,
"longitude": -64.0208
},
{
"id": 7832,
"latitude": 79.7713,
"longitude": -44.1084
}
]
但我无法弄清楚如何使用MKNetworkOperation
是的,它被设置为MKNKPostDataEncodingType JSON。 OK,所以我想我需要扩展网络工具包以使NSArray * fetchedObjects = [managedObjectContext executeFetchRequest:fetchRequest error:&error]; MKNetworkOperation * op = [self operationWithPath:@“thestore/services/storeservice.svc/getfavorites” params:fetchedObjects httpMethod:@“POST”]; –