开发者

Objective-C fetch POST content with custom headers synchronously

开发者 https://www.devze.com 2023-03-11 09:17 出处:网络
I need to establish a connection to myPage.php, send it certain POST parameters and use a custom header. All this I need to be done synchronously and the content returned as an NSString, and only retu

I need to establish a connection to myPage.php, send it certain POST parameters and use a custom header. All this I need to be done synchronously and the content returned as an NSString, and only returned once I have gotten the content, so I don't have to deal with asynchronous requests and set up delegates and stuff.

All that I need in Objective-C.

Do you know a simple way? Thanks in advance!

开发者_如何学C

EDIT: Thanks for your answers! But, just out of curiosity, is there a solution that doesn't require additional frameworks and libraries?


In case you cannot use ASIHttpRequest, just use a NSMutableURLRequest instead of NSURLRequest, like this.


Use ASIHttpRequest, makes things quite easy

0

精彩评论

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