ios - AFNetworking GET Parameters in body -
i have following code , want force parameters in body of call , not part of query string
nsstring * requesturl = [nsstring stringwithformat:kxxxbaseapiurl,@"findfriends"]; nsstring * lastcalltime = [[xxxcommon sharedinstance] lasttimestampforurl:requesturl]; afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; afhttprequestserializer * serializer =[afjsonrequestserializer serializer]; [[xxxcommon sharedinstance].currentaccount addauthorization:serializer]; [manager setrequestserializer:serializer]; [manager.requestserializer setvalue:lastcalltime forhttpheaderfield:@"if-modified-since"]; [manager get:requesturl parameters:@{@"id":[xxxcommon sharedinstance].currentaccount.userid, @"details" : [[xxxcommon sharedinstance].contactfriends valueforkey:@"user_key"]} success:^(afhttprequestoperation *operation, id responseobject) { nslog(@"%@",responseobject); } failure:^(afhttprequestoperation *operation, nserror *error) { nslog(@"request failed error: %@, %@ ", error, error.userinfo); }];
the details parameter large array , don't want them in query string, looks this
http://xxx/api/findfriends?details[]=%2b4823483943&details[]=%2b234098234234&details[]=%2b99999&details[]=%2b77777777&details[]=%2b999884&details[]=%2b393949944
nsurlconnection
underlies afhttprequestoperation
not allow body in request. in general not allow body though curl , works on server.
if want send body use post request.
Comments
Post a Comment