1

I've seen a few articles, forum posts talking about uploading a file using NSURLRequest and NSURLConnection. Some of the ones I've seen are:

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?

Community
  • 1
  • 1
synic
  • 25,874
  • 18
  • 106
  • 144

1 Answers1

-1

One word

ASIHTTPFormRequest

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

Andiih
  • 12,045
  • 9
  • 55
  • 88
  • Thanks! Exactly what I was looking for. – synic May 12 '10 at 19:19
  • 4
    That doesn't actually answer the question. Introducing a dependency to your application when cocoa can already handle should be done very discerningly. – DexterW Jun 24 '11 at 19:17
  • 1
    the bit of the question "Or even better, is there already a class out there that builds on NSURLRequest that I could use?" hints that the OP may not mind a library, but I agree with you re use of external dependencies. However, ASIHTTP library is so useful I've long since swapped out my home grown lib for it. – Andiih Jun 24 '11 at 19:23