Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8367177
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:05:34+00:00 2026-06-09T13:05:34+00:00

Lets say that I have to do this dynamic PUT request: http://mydomain.com/api/5?value=66 The body

  • 0

Lets say that I have to do this dynamic PUT request:
“http://mydomain.com/api/5?value=66”

The body is empty.
I will get in return a 201 (Created) status, and in the body I’m getting back a json object,
Let’s call it MyObject that has fields NSNumber* Id, NSString* name;

Now in restkit I have these options:

- [[RKObjectManager sharedManager]  putObject:nil mapResponseWith:MyMapping delegate:self]; 

MyMapping maps MyObject.
The problem is that if I’m sending nil, it doesn’t know the mapping and throws “Unable to find a routable path for object of type ‘(null)’ for HTTP Method ‘PUT'”

- [[RKClient sharedClient] put:putUrl params:nil delegate:self];

where putUrl = "http://mydomain.com/api/5?value=66"
The problem here is that there is no mapping for the response so only didLoadResponse is called back and didLoadObjects never called

[objectManager.router routeClass:[MyObject class] toResourcePath:putUrl forMethod:RKRequestMethodPUT]; 
    MyObject *obj = [[MyObject alloc] init];

    [[RKObjectManager sharedManager]  putObject:obj mapResponseWith:MyMapping  delegate:self];

The problem here is that first that I fake it (send MyObject as param while it isn’t) and it works only for the first time. for the second time I’m trying to use this method I’m getting this exception: “A route has already been registered for class ‘MyObject’ and HTTP method ‘PUT'”

Any suggestion what to do?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:05:35+00:00Added an answer on June 9, 2026 at 1:05 pm

    If anyone is intersted I found the answer after seeing what restkit is doing.

    putUrl = "http://mydomain.com/api/5?value=66";
    
    MyMapping maps the returned MyObject that has fields NSNumber* Id, NSString* name;
    

    Here is the code to get it working:

    void (^blockLoader)(RKObjectLoader *);
    
    blockLoader = ^(RKObjectLoader *loader) {
        loader.delegate = self;
        loader.objectMapping = MyMapping;
    };
    
    NSString *resourcePath = putUrl;
    
    [[RKObjectManager sharedManager] sendObject:nil toResourcePath:resourcePath usingBlock:^(RKObjectLoader *loader) {
        loader.method = RKRequestMethodPUT;
        blockLoader(loader);
    }];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, lets say that we have this structure: <div id='allTempLinkHolder'> <div class='tempLink'>Value</div> <div class='tempLink'>Value
Lets say that we have a query like this one: SELECT *, (CUSTOM_EXPRESSION) as
Lets say that i have img tag like this, <img src = myimage.jpg width
Lets say that I have three tables, customers, orders and orderDetails. I'm doing this:
Lets say I have one table called REVIEWS This table has Reviews that customers
Lets say I have a class A that is fairly simple like this -
Let's say that I have this string: s = '<p>Hello!</p>' When I pass this
I have this table: id feed_id ... Let's say that I have 500 rows
Let's say that I have something like this in my web.xml file. <filter name=foo>
Let's say that I have a method that looks like this: def raise_if_client_status_error(xml_resp) #

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.