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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:00:00+00:00 2026-05-26T07:00:00+00:00

I am trying to POST a sample data to a server using REST api

  • 0

I am trying to POST a sample data to a server using REST api from ASIHTTPRequest in iphone. When i try from REST client from mozilla browser , I get success code 200 . But when i try from iphone i get 415 code and the error message reads as “Cannot consume content type” and “The supplied request data is not in a format acceptable for processing by this resource.”

Here is my code,

    ASIFormDataRequest *request2 = [ASIFormDataRequest requestWithURL:myurl];   
    [request2 setUsername:User_Name ];
    [request2 setPassword:Pass_Word];
    [request2 addRequestHeader:@"Content-Type" value:@"application/xml;version=1"];
    [request2 setPostBody:[NSMutableData dataWithData:mydata dataUsingEncoding:NSUTF8StringEncoding]]];

    [request2 setRequestMethod:@"POST"];
    [request2 setDelegate:self];
    [request2 startAsynchronous];

Please help me to solve this issue.

Thanks and Regards,
Vinod.

  • 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-26T07:00:00+00:00Added an answer on May 26, 2026 at 7:00 am

    I’m guessing there’s something wrong with the content-type header you’re setting. I’ve had a possibly unrelated issue where a content-type of application/xml wasn’t accepted and a content-type of text/xml was being processed by the web server.

    One way to debug this I think is to use something like https://addons.mozilla.org/en-US/firefox/addon/httpfox/ to look at the raw HTTP request that goes out when you access the website through your browser and set the same headers in ASI.

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

Sidebar

Related Questions

I am trying to post data to my server (vb.net) using mobile devices. I've
I'm trying to POST a http request using ajax, but getting a response from
I'm trying to retrieve data using the new graph API, however the token I'm
I'm trying to post some very simple data to a php file using jquery
I'm trying to submit some post data form using vbscript. The site I'm posting
I'm trying to send a multi-line post from an iPhone/iPad to a php service,
I'm trying to post some code on a blog using the pre tag. Something
I'm trying to post to a webpage using WebClient in C#. Somehow the parameters
I'm trying to send a simple POST request to a REST web service and
I'm trying to connect to the last.fm rest services using restsharp. I can deserialize

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.