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

  • Home
  • SEARCH
  • 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 8359943
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:18:42+00:00 2026-06-09T11:18:42+00:00

I’m trying to do a fairly basic HTTP PUT using RestKit. I don’t want

  • 0

I’m trying to do a fairly basic HTTP PUT using RestKit. I don’t want to put the entire object, since the API call was designed to accept a single query parameter and just update that field. I’ve tried two approaches so far, both unsuccessful.

URL to post to: https://myserver/api/users/{userId}

Query string parameter: verificationCode=

Example usage: PUT https://myserver/api/users/101?verificationCode=646133

Approach #1: Put the query parameter in a RKParams object and make the PUT call with those params.

    NSString *putUrl = [NSString stringWithFormat:@"/api/users/%i", [APIUserInfo sharedAPIUserInfo].apiUserIdx];
    NSLog(@"the PUT url is %@", putUrl);

    // Send a PUT to a remote resource. The dictionary will be transparently
    // converted into a URL encoded representation and sent along as the request body
    NSDictionary* paramsDict = [NSDictionary dictionaryWithObject:[_verificationCode text] forKey:@"verificationCode"];
    // Convert the NS Dictionary into Params
    RKParams *params = [RKParams paramsWithDictionary:paramsDict];

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

Approach #2: Build the entire url and try a PUT with params set to nil.

    NSString *putUrl = [NSString stringWithFormat:@"/api/users/%i?verificationCode=%@", [APIUserInfo sharedAPIUserInfo].apiUserIdx, [_verificationCode text]];
    NSLog(@"the PUT url is %@", putUrl);

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

Neither approach is working for me. The first fails saying “RestKit was asked to retransmit a new body stream for a request. Possible connection error or authentication challenge?” then runs for about 10 seconds and times out. The second approach fails saying HTTP Status 405 – Method Not Allowed.

Can anyone point out where I’m going wrong, or provide me with a simple PUT example using RestKit? Most of the examples I’ve found at there are putting the entire object which I don’t want to do in this case.


UPDATE:

Approach #2 worked well once I got a few things sorted out on the server side. Final solution:

NSString *putUrl = [NSString stringWithFormat:@"/api/users/verify/%i?verificationCode=%@", [APIUserInfo sharedAPIUserInfo].apiUserIdx, [_verificationCode text]];
NSLog(@"the PUT url is %@", putUrl);

[[RKClient sharedClient] put:putUrl params:nil delegate:self];
  • 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-09T11:18:44+00:00Added an answer on June 9, 2026 at 11:18 am

    the HTTP PUT method is disabled on your webserver. It is by default on all webserver for security reasons.

    HTTP Status 405 - Method Not Allowed.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am trying to loop through a bunch of documents I have to put
I'm making a simple page using Google Maps API 3. My first. One marker
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but

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.