RoutingHTTPServer icon indicating copy to clipboard operation
RoutingHTTPServer copied to clipboard

Parse multipart/form-data parameters

Open mattstevens opened this issue 14 years ago • 4 comments

Automatically parse parameters from HTML forms into the params dictionary.

mattstevens avatar Dec 21 '11 03:12 mattstevens

Need to consider large uploads or at least enforce a maximum size.

mattstevens avatar Dec 21 '11 03:12 mattstevens

First, I think what you have done is awesome and makes CocoaHTTPServer very easy to use!

I'm using ASIFormDataRequest from the ASIHTTPRequest project, and was wondering how you would recommend retrieving the post values from the request body. I'm not an HTTP pro, so I'm not exactly sure how it all should be parsed. I tried using [request param:@"myPostValueKey"], but that didn't work.

Thanks!

amigi avatar Feb 28 '12 02:02 amigi

Thanks, glad you've found it useful! Right now form data is just delivered in its raw form which you can get at with [request body]. I'm afraid I don't have any code to parse it yet, but you might be able to find a class or library where someone has done this already.

mattstevens avatar Feb 28 '12 04:02 mattstevens

Thanks for the fast response! Ok no problem--I will look for a parser and I'll let you know if I come up with anything.

amigi avatar Feb 28 '12 06:02 amigi