I am pretty new to the Restkit. I know how my restful response will be. Its not ready yet to get from the server side. Is there a way to give dummy input directly to restkit ?
We can give json
text file as an input to NSUrlConnection
, similarly how to do it here?
Asked
Active
Viewed 139 times
1
-
1Maybe you can look for this kind of method : http://stackoverflow.com/questions/8788904/what-is-an-easy-way-to-stub-dummy-a-restful-web-service – Zaphod Nov 12 '12 at 10:51
2 Answers
0
I have been able to do this is
- (RKObjectMappingResult*)mapResponseWithMappingProvider:(RKObjectMappingProvider*)mappingProvider toObject:(id)targetObject error:(NSError**)error {
in RKObjectLoader.m
where I optionally read a static json text file and replace the bodyAsString. If you look at
[self.URL description]
you can scan the URL and maybe read a test file based on the request url

ahwulf
- 2,584
- 15
- 29
0
How about running a simple web server which will return any output you want in JSON format? For example, when I need to prototype an app which will use RestKit, I create a simple ruby app using sinatra web framework (few lines of code) and start it locally, and point my RestKit based app to web app (http://www.sinatrarb.com)

Alex Kurkin
- 1,069
- 10
- 17