ios - How to set header values in Restkit -


i trying set header values restkit calls. however, these not seem work.

i want set content-type , accept headers application/json

any idea problem is?

thanks!

rkobjectmanager *objectmanager = [rkobjectmanager sharedmanager]; [[objectmanager client] setvalue:@"application/json" forhttpheaderfield:@"accept"]; [[objectmanager client] setvalue:@"application/json" forhttpheaderfield:@"content-type"]; rkurl *url = [rkurl urlwithbaseurl:[objectmanager baseurl] resourcepath:@"/users/sign_in.json" queryparameters:params]; [objectmanager loadobjectsatresourcepath:[nsstring stringwithformat:@"%@?%@", [url resourcepath], [url query]] delegate:self]; 

i don't think it's obvious, though in documentation (and haven't tried tbh) on object manager there serializationmimetype property. there's constant json defined, code like:

objectmanager.serializationmimetype = rkmimetypejson; 

according docs, application/json default accept anyway, can specified acceptmimetype property.


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -