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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:08:34+00:00 2026-05-25T03:08:34+00:00

I am using the instructions provided in the ASI page here . I am

  • 0

I am using the instructions provided in the ASI page here. I am trying to send some data to a web service and not seeing any results.

This is my sendRequest method which gets called in viewDidLoad

-(void)sendRequest {
    NSURL *url = [NSURL URLWithString:@"http://153.60.6.75:8080/BarcodePayment/transactions"];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
    [request addRequestHeader:@"Accept" value:@"application/json"];
    [request addRequestHeader:@"Content-Type" value:@"application/json"];
    NSString *dataContent = @"{\"id\":7,\"amount\":7.0,\"paid\":true}";
    NSLog(@"dataContent: %@", dataContent);
    [request appendPostData:[dataContent dataUsingEncoding:NSUTF8StringEncoding]];
    [request setRequestMethod:@"POST"];
}

I check the dataContent string and the output is

{"id":7,"amount":7.0,"paid":true}

If I use curl from Terminal, I checked and this command works.

curl -X POST -H 'Accept:application/json' -H 'Content-Type: application/json' http://153.60.6.75:8080/BarcodePayment/transactions/ --data '{"id":7,"amount":7.0,"paid":true}'

My understanding is that in using curl, I set it to json, specify the address, specify the data which is equivalent to dataContent in my code. Nothing happens. What’s wrong?

Thanks for the help!

  • 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-25T03:08:35+00:00Added an answer on May 25, 2026 at 3:08 am

    You have pretty much everything except the most crucial component which is to start the request

    You need to add [request startSynchronous]; for a Synchronous Request or [requester startAsynchronous]; for a Asynchronous request (and you possibly need the Delegate Methods to handle any response you have back)

    This is all covered pretty nicely in the ASIHTTPRequest How to Use Guide. The Sections most relevant to this would be ‘Creating a synchronous request’ and ‘Creating an asynchronous request’. Also something to think about taken from that page:

    In general, you should use asynchronous requests in preference to synchronous requests. When you use ASIHTTPRequest synchronously from the main thread, your application’s user interface will lock up and become unusable for the duration of the request.

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

Sidebar

Related Questions

I'm setting up a net.tcp WCF service using instructions here: http://blogs.msdn.com/swiss_dpe_team/archive/2008/02/08/iis-7-support-for-non-http-protocols.aspx One of the
I am trying to install the apache module for passenger using the instructions provided
I am using the next instructions to get some registers from my Database. Create
Can someone point me to videos/blogs/instructions on using Web Testing in Visual Studio 2008
There are instructions here to create a C# assembly using the SimMetrics library. The
Anyone out there using the FTUtils library for iPhone development? Following the instructions here
I'm trying to set up OpenID authentication in Django, using django-authopenid. The instructions are
I'm working with client who provided me with somewhat vague instructions. Here's what I'm
I was trying to follow the instructions provided in this reply to the question
Im using a linux machine, and I followed the instructions seen on https://www.php.net/manual/en/install.php to

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.