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 7549673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T10:00:22+00:00 2026-05-30T10:00:22+00:00

using loadObjectAtResourcePath on GET method, doesn’t include my parameters on the requests. for example,

  • 0

using loadObjectAtResourcePath on GET method, doesn’t include my parameters on the requests.

for example, if I send:

[RKObjectManager objectManagerWithBaseURL:@"http://something/ws"];
    [[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/res" delegate:self block:^(RKObjectLoader *loader) {
        NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
                              @"val", @"param1",
                              nil];
        loader.params = [RKParams paramsWithDictionary:dict];
    }];

the final url request doesn’t include the “?param1=val” part – why?

  • 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-05-30T10:00:23+00:00Added an answer on May 30, 2026 at 10:00 am

    Update Months Later

    The real answer is that loader.params creates the HTTP BODY, hence it works for POST, PUT, DELETE etc but not for GET where the params are appended to the URL.

    Hence, the answer below still works if you’re facing the same issue for GET, but if you’re sending out GET requests, it’s mostly using methods that attach the params to the query string.

    To summarize the differences between the two.

    Sending params in the HTTP Body(i.e. POST, UPDATE, DELETE)

    // Convert a NS Dictionary into Params
    RKParams *params = [RKParams paramsWithDictionary:optionValues];
    
    // I use sendObject to skip the router. Otherwise it's normally postObject
    [[RKObjectManager sharedManager] sendObject:yourObject toResourcePath: yourResourcePath usingBlock:^(RKObjectLoader *loader) {
        loader.method = RKRequestMethodPOST;
        loader.delegate = delegate;
        loader.params = params; // This sets params in the POST body and discards your yourObject mapping
    
    } ];
    

    Caveat Emptor (for above)

    Setting params in the block destroys any mapping that you might have set in yourObject, kind of defeats the purpose of using object mapping. There’s a fix here by Sebastian loader.params – Extra params if you really want to use this method to append extra parameters to your Post not in the object.

    Sending in params as Query String (i.e. GET)

    // Make a NS dictionary and use stringByAppendingQueryParameters
    NSDictionary *shopParams = [NSDictionary dictionaryWithKeysAndObjects:
                                    @"limit",@"20", 
                                    @"location",@"latitude,longitude",
                                    nil];
    
    [[RKObjectManager sharedManager] loadObjectsAtResourcePath:[@"/api/v1/shops.json" stringByAppendingQueryParameters:shopParams] delegate:objectDelegate];
    

    The rest of the answer is just for reference, I’m a hoarder.


    Old Answer

    I’m using RestKit for my project and facing the same issue.

    I think RKParams is mainly used to do POST requests. I cannot fully decipher your code because 1) I don’t know loader‘s declaration? 2) RKParams is not to be used with Object Manager?

    I did this.

    Loader Method in App Delegate

    NSDictionary *shopParams = [NSDictionary dictionaryWithKeysAndObjects:@"limit",@"30", nil]; 
    
    [[RKClient sharedClient] get:@"/api/v1/shops.json" queryParams:shopParams delegate:self];
    

    Delegate

    - (void)requestDidStartLoad:(RKRequest *)request {
        NSLog(@"RK Request description: %@",[request description]);
    }
    

    Output:
    RK Request description: <RKRequest: 0x7993db0> and rails log say {"limit"=>"30"}.

    From the autocomplete in Xcode, you can see the get request didn’t even use RKParams. Just a NSDict. The POST requests uses it.

    My goal is to attach a query string, i.e. ?location=singapore&etcetc to my API methods in Rails. For this, RK comes with a NSString addon called appendQueryParams RK docs link that you can use to append query params.

    If your goal is POST images etc, you can follow the above line of thought of using RKClient.

    Update:

    If you just want to append parameters to Object Manager

     NSDictionary *shopParams = [NSDictionary dictionaryWithKeysAndObjects:
                                    @"limit",@"20", 
                                    @"location",@"latitude,longitude",
                                    nil];
    

    This is outdated and marked for deprecation.


     [[RKObjectManager sharedManager] loadObjectsAtResourcePath:[@"/api/v1/shops.json" appendQueryParams:shopParams] delegate:self];
    

    Use this instead:

     [[RKObjectManager sharedManager] loadObjectsAtResourcePath:[@"/api/v1/shops.json stringByAppendingQueryParameters:shopParams] delegate:yourLoaderDelegate];
    

    Rails Log: {"location"=>"latitude,longitude", "limit"=>"20"}

    Hope in my answer I didn’t make any wrong statements.

    Refer to this question RestKit GET query parameters.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters
Using Rails 3.2.0.rc2 and ruby 1.9.3p0 In app/views/requests/_form.html.erb I have the following code for
using file_get_contents , I open an Internet URL and get the contents of this
Using Google Maps InfoBox - http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/docs/reference.html Currently the map will scroll - pan control
Using the current request I can get the URL hostname with: HttpContext.Current.Request.Url.Host But -
Using the http://www.ifans.com/forums/showthread.php?t=132024 post from another question i am allowing the user to enter
Using the C# Facebook SDK 5.0.3 everything works fine whit the client.Get(/me). But when
Using Java Reflection, is it possible to get the name of a local variable?
Using ruby(1.8.7) , rails(2.3.8) , rspec(1.3.1) and rspec-rails(1.3.3) how do I test a method
Using online interfaces to a version control system is a nice way to have

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.