5
votes

I am integrating RestKit with my project. I am using the version RestKit-0.20.2. Is there any way we can do the requests without object mapping in this version? I want to do the same thing the poster does here: Parsing JSON without Object Mapping in Restkit iOS. But it seems its a old version, and RKClient is not available in 0.20.2.

Is it possible to do request without object mapping using RestKit-0.20.2?

P.S.: I searched in Google and I could not be able to find/recognize the correct answer for my question as I am new to RestKit.

Thanks everyone!

2
Why not use the underlying AFNetworking classes? - Wain
Great. I think AFNetworking will help me. Thanks a lot. You would like to post this as an answer? Or do you think we should delete this post? Please let me know. Thanks. - EmptyStack
As there was a question about the previous version of RestKit too it seems reasonable that this one should stay here and have an actual answer. - Wain

2 Answers

5
votes

RestKit uses AFNetworking to perform all of its raw network communication and builds mapping on top. So, if you need to make requests without mapping you have full access to the AFNetworking classes to do so.

2
votes

I needed to send a PUT without object (and with Basic authorization). After trying different approaches, I finally sent the request using AFHTTPClient directly:

AFHTTPClient* client = [AFHTTPClient clientWithBaseURL:[NSURL URLWithString:@"http://the.host"]];
[client setAuthorizationHeaderWithUsername:username password:password];
[client putPath:@"/api/resource" parameters:nil success:success failure:failure];