开发者

post data JSON webservice [closed]

开发者 https://www.devze.com 2023-02-22 23:57 出处:网络
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical andcannot be reasonably answered in its current form. For help clari
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

i want to post data on a server and i am using jSON webservice.

i know how to get data from server using Json but don't know ab开发者_StackOverflow中文版t posting data can any one help me plz....


you can create a NSURLConnection set the content type to text/json and POST it as a string or you can use ASIHTTPRequest for easier connection management.

NSURL* url = [NSURL URLWithString:@"http://www.someurl.com"];
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];
[request setRequestMethod:@"POST"];
[request setPostValue:[jsonString stringByAddingPercentEscapesUsingEncoding:NSISOLatin1StringEncoding] forKey:@"data"];

[request startAsynchronous];
0

精彩评论

暂无评论...
验证码 换一张
取 消