imsatasia
imsatasia

Reputation: 149

POST REST-Web-Service Call for iPhone application

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.

Upvotes: 2

Views: 2374

Answers (1)

Hua-Ying
Hua-Ying

Reputation: 3166

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

Upvotes: 6

Related Questions