Do a simple json POST using RESTKit

后端 未结 2 454
一个人的身影
一个人的身影 2020-12-09 04:04

I\'m new to iOS development and I\'m having trouble making a simple Json POST request. I have a NSDictionary containing an user and password and I want to send those values

2条回答
  •  攒了一身酷
    2020-12-09 04:54

    For older RestKit

    You probably have something like this in your delegate:

        objectManager.serializationMIMEType = RKMIMETypeFormURLEncoded;
    

    You want it to be:

        objectManager.serializationMIMEType = RKMIMETypeJSON;
    

    For RestKit v.20:

        // thanks  ColdLogic (from his comment)
        [objectManager setRequestSerializationMIMEType:RKMIMETypeJSON];
    

提交回复
热议问题