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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:21:36+00:00 2026-06-05T14:21:36+00:00

I have the following API call: URL: /api/some-call Method: PUT PARAMS: No params Its

  • 0

I have the following API call:

URL: /api/some-call
Method: PUT
PARAMS: No params

Its just a simple PUT method. I am trying to use AFNetworking to do that and unfortunately, I am failing. Here’s what I have right now:

AFHTTPClient *httpClient = [[AFHTTPClient alloc] initWithBaseURL:url];
NSMutableURLRequest *req = [httpClient requestWithMethod:@"PUT" path:@"" parameters:nil];

AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:req];

[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
    NSLog(@"Success");
} failure: ^(AFHTTPRequestOperation *operatn, NSError *error) {
    NSLog(@"Failure");
}];

NSOperationQueue *queue = [[NSOperationQueue alloc] init];
[queue addOperation:operation];

This is however, not working. Why is that? Furthermore, what is path supposed to be in a PUT request? I’ve tried several things and this is what I have now at the end, which I believe should be close to what is correct.

One last question: AFNetworking does not use ARC. Does that mean I still need the autorelease at the end of the NSOperationQueue statement?

EDIT:
Here is error NSLog: Failure Error Domain=com.alamofire.networking.error Code=-1011 "Expected status code in (200-299), got 409" UserInfo=0x7a91fb0 {NSErrorFailingURLKey=*the url*/api/some-call, NSLocalizedDescription=Expected status code in (200-299), got 409}

  • 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-05T14:21:37+00:00Added an answer on June 5, 2026 at 2:21 pm

    Well. You are getting a 409 error code.

    Quoted from http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html :

    10.4.10 409 Conflict

    The request could not be completed due to a conflict with the current
    state of the resource. This code is only allowed in situations where
    it is expected that the user might be able to resolve the conflict and
    resubmit the request. The response body SHOULD include enough

    information for the user to recognize the source of the conflict.
    Ideally, the response entity would include enough information for the
    user or user agent to fix the problem; however, that might not be
    possible and is not required.

    Conflicts are most likely to occur in response to a PUT request. For
    example, if versioning were being used and the entity being PUT
    included changes to a resource which conflict with those made by an
    earlier (third-party) request, the server might use the 409 response
    to indicate that it can’t complete the request. In this case, the
    response entity would likely contain a list of the differences between
    the two versions in a format defined by the response Content-Type.

    Which means the error is caused by your server not with your code. unless you have provided some wrong parameters.

    Well. As for the question regarding the “what is the path supposed to be in PUT”.
    Normally I’ll put baseURL as the domain name of the server.
    Which is something like

    http://localhost 
    

    then i’ll put the path to be something like

    @"the/rest/of/the/api/url"
    

    then it’s easier to switch between development and production servers with just a switch of a baseURL. 🙂

    And for your last question, “AFNetworking does not use ARC. Does that mean I still need the autorelease at the end of the NSOperationQueue statement?”

    Does that mean your project is using ARC with AFnetworking, or AFNetworking WITHOUT ARC.

    if it’s ARC with AFNetworking, you don’t have to. Take a look at this
    https://github.com/AFNetworking/AFNetworking#arc-support

    if it’s non-ARC with AFNetworking, you basically have to do all the memory management yourself. 🙂
    Hit me up again if you need more info and i’ll edit accordingly. 🙂

    Hope i’ve helped in someway.

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

Sidebar

Related Questions

I have the following restful api ajax call: $.ajax({ type: POST, url: https://website.com/a/login, data:
I'm trying to convert the following NSString api call to a NSURL object: http://beta.com/api/token=
I am trying to call an sms api using a http url .I am
I have written down the following code: var url = http://maps.googleapis.com/maps/api/geocode/json?latlng=+position.coords.latitude+,+position.coords.longitude+&sensor=false&callback=parseMe; console.log('URL is --
i have the following basic script to make an api call to vimeo and
I have following ajax call in my JavaScript code url = 'http://news.ycombinator.com/?callback=?'; $.ajax({url:url ,async:!1,dataType:'script',
currently I have the following which parses a json api.. import simplejson import urllib2
I have the following json returned to me from an API. sections: { 1:
I have the following action in my ASP.NET Web API: public IEnumerable<Car> carssOfUser(int id,
I'm using eclipse. In the WEB-INF/lib folder I have the following jars. jstl-api-1.2.jar jstl-impl-1.2.jar

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.