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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:12:28+00:00 2026-06-15T17:12:28+00:00

Everything is fine with POST requests, but couldn’t find a way to work with

  • 0

Everything is fine with POST requests, but couldn’t find a way to work with PUT or DELETE?

 NSMutableURLRequest *mutableRequest = [[NSMutableURLRequest alloc] init];        
[mutableRequest setURL:[NSURL URLWithString:[NSString 

    stringWithFormat:@"http://abc.com/update/27"]]];
            [mutableRequest setHTTPMethod:@"PUT"];
            [mutableRequest addValue:@"application/json" forHTTPHeaderField:@"Accept"];
            [mutableRequest addValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
            [mutableRequest addValue:@"PUT" forHTTPHeaderField:@"X-HTTP-Method-Override"];
            [mutableRequest addValue:sessionId forHTTPHeaderField:@"ZURMO_SESSION_ID"];
            [mutableRequest addValue:token forHTTPHeaderField:@"ZURMO_TOKEN"];
            [mutableRequest addValue:@"REST" forHTTPHeaderField:@"ZURMO_API_REQUEST_TYPE"];
            NSString *postLength = [NSString stringWithFormat:@"%d",[postdata3 length]];
            [mutableRequest addValue:postLength forHTTPHeaderField:@"Content-Length"];
            [mutableRequest setHTTPBody:postdata3]

This is how server side(PHP) handles api calls, with PUT,GET,POST and DELETE. Any help would be appreciated thanks

public static function createApiCall($url, $method, $headers, $data = array())
    {
        if ($method == 'PUT')
        {
            $headers[] = 'X-HTTP-Method-Override: PUT'; //also tried this one to add header
        }

        $handle = curl_init();
        curl_setopt($handle, CURLOPT_URL, $url);
        curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, false);
        curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);

        switch($method)
        {
            case 'GET':
                break;
            case 'POST':
                curl_setopt($handle, CURLOPT_POST, true);
                curl_setopt($handle, CURLOPT_POSTFIELDS, http_build_query($data));
                break;
            case 'PUT':
                curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'PUT');
                curl_setopt($handle, CURLOPT_POSTFIELDS, http_build_query($data));
                break;
            case 'DELETE':
                curl_setopt($handle, CURLOPT_CUSTOMREQUEST, 'DELETE');
                break;
        }
        $response = curl_exec($handle);
        return $response;
    }
  • 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-15T17:12:29+00:00Added an answer on June 15, 2026 at 5:12 pm

    It’s hard to tell without knowing the explicit error.

    The use of the PUT or DELETE is often implemented by “hidden parameters” called _method.
    It’s not only specific for example a Spring MVC’s tag library, but is also used by a few other client frameworks. Spring is just following the convention, such as it is.

    In order to use this properly, you have to know how your backend is handling with PUT or DELETE requests.

    In spring for example you need to define a filter (HiddenHttpMethodFilter, see javadoc), which turns the _method parameter into a “real” HTTP method representation in the HttpServletRequest. This is done as a filter to emphasise the fact the the lack of PUT and DELETE is a browser problem – the servlet API supports it just fine.

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

Sidebar

Related Questions

I started using Zend_Paginator, it works everything fine but I noticed that there is
Everything is fine and the final problem is so annoying. Compile is great but
Until yesterday everything was fine to my localhost, but starting yesterday, localhost is not
Everything seems to work fine until i want to submit the form and update
I am hitting a struts action using AJAX, everything is fine but there is
this is my first post on stackoverlow and I couldn't find a solution to
i implemented a listview which implements SectionIndexer ... everything fine so far. Normally the
Everything's fine building in xcode and testing the app until I built in for
Everything works fine locally when I do as follows: cat input | python mapper.py
Everything works fine, the only problem is that it loads very slow. It takes

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.