开发者

iPhone: multi-part post using NSURLRequest

I've seen a few articles, forum posts talking about uploading a file u开发者_运维技巧sing NSURLRequest and NSURLConnection. Some of the ones I've seen are:

  • http://forums.macrumors.com/showthread.php?t=427513
  • How can I upload a photo to a server with the iPhone?
  • http://www.cocoadev.com/index.pl?HTTPFileUploadSample

However, most of them don't include any sort of variables along with the file. Say I wanted to post the following variables (and their values) along with a photo:

user_id = 121
caption = this photo is awesome
thumbnail_x = 12
thumbnail_y = 0
thumbnail_w = 100
thumbnail_h = 200
photo = [file]

Is there a way to do this?

Or even better, is there already a class out there that builds on NSURLRequest that I could use?


One word

ASIHTTPFormRequest

http://allseeing-i.com/ASIHTTPRequest/

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜