Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RestKit - Request without object mapping

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!

like image 272
EmptyStack Avatar asked Jun 15 '13 10:06

EmptyStack


2 Answers

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.

like image 105
Wain Avatar answered Nov 12 '22 03:11

Wain


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];
like image 2
Ferran Maylinch Avatar answered Nov 12 '22 04:11

Ferran Maylinch