ios - Get non-json content from AFNetworking -


i trying text displayed in resulting page code snipped looking json only.

afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; nsdictionary *parameters = @{@"userid": [loggedparent getobjectid]}; [manager post:@"http://myurl" parameters:parameters success:^(afhttprequestoperation *operation, id responseobject) {   nslog(@"json: %@", responseobject);   } failure:^(afhttprequestoperation *operation, nserror *error) {        nslog(@"error: %@", error);    }]; 

this error get:

error domain=nscocoaerrordomain code=3840 "the operation couldn’t completed. (cocoa error 3840.)" (json text did not start array or object , option allow fragments not set.) userinfo=xxxxxxxxx {nsdebugdescription=json text did not start array or object , option allow fragments not set.}

how modify code read , save text displayed?

i'm assuming you're in afnetworking 2.0, haven't used. looks should able modify responseserializer property in afhttprequestoperationmanager accept whatever content type server sending. afhttpresponseserializer has acceptablecontenttypes field can modify.

however, given error you're seeing seems server may returning "application/json" content-type not delivering valid json content.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -