views:

373

answers:

1

Hello Friends,

Anyone have idea how to pass value from iPhone application to the REST-Webservice using POST method.?

ex: http://mysite.com/services/updatescore/uid=1234&score=12658

I want to send this information using POST request. - How can I do it.?

Thanks.

+2  A: 

I use ASIHTTPRequest

ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setPostValue:@"Ben" forKey:@"first_name"];
[request setPostValue:@"Copsey" forKey:@"last_name"];
[request setFile:@"/Users/ben/Desktop/ben.jpg" forKey:@"photo"];

See http://allseeing-i.com/ASIHTTPRequest/How-to-use for more info

Hua-Ying