• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Access a servlet using ASIHTTPRequest
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Access a servlet using ASIHTTPRequest


  • Subject: Access a servlet using ASIHTTPRequest
  • From: Bing Li <email@hidden>
  • Date: Sat, 26 Feb 2011 10:32:29 +0800

Dear all,

I tried to access a servlet using ASIHTTPRequest.

The servlet is designed according to the link, http://archive.corewebprogramming.com/Chapter19/cwp/ThreeParams.java. It works fine when sending data through the HTML, http://archive.corewebprogramming.com/Chapter19/cwp/ThreeParamsForm.html.

However, when doing that with ASIFormDataRequest, data is not received by the servlet. The Objective-C code is listed as follows. I write them according to the link, http://allseeing-i.com/ASIHTTPRequest/How-to-use.

        URL *url = "" URLWithString:urlString];
        ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL: url];
        [request setPostValue:p1 forKey: @"param1"];
        [request setPostValue:p2 forKey: @"param2"];
        [request setPostValue:p3 forKey: @"param3"];
        [request startSynchronous];
        NSError *error = [request error];
        if (!error)
        {
                NSLog(@"Sending data well!");
        }
        else
        {
                NSLog(@"Sending data wrongly");
        }
        
        [url release];
        [request release];

Anything wrong with the code?

I appreciate so much for your help!

Best regards,
Bing
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: A Newbie Question
  • Next by Date: Time out a connect() call
  • Previous by thread: Re: A Newbie Question
  • Next by thread: Time out a connect() call
  • Index(es):
    • Date
    • Thread