ios - AFHttpClient post with both parameters and JSON in body -
sorry, im kinda newb regarding http post terminology!
i have post webservice cannot changed: format follows:
http://somewebaddress/json/getallfeedsrestfullywrapped?usertoken=foo so parameters are:
key:usertoken , value=foo
in body need put json formatted array this:
{"feedids":[1,2,3,4,5,6]}
im trying accomplish afnetworking cannot seem make work situation.
i have tried both afhttpclient , afjsonreqestioperation im not able combine request , body correct.
so hope knows how this. appreciated.
try that
[[yourhttpclient sharedhttpclient] postpath:@"getallfeedsrestfullywrapped?usertoken=foo" parameters:[nsdictionnary {"feedids":[1,2,3,4,5,6]}] success:^(afhttprequestoperation *request, id json) { } failure:^(afhttprequestoperation *request, nserror *error) { }];
Comments
Post a Comment