[web-devel] Yesod/WAI and multipart/form-data encoded post requests
Gregory Collins
greg at gregorycollins.net
Mon Feb 14 19:33:01 CET 2011
The multipart/form-data spec sucks, doesn't it?!!
G
On Mon, Feb 14, 2011 at 2:26 AM, Max Cantor <mxcantor at gmail.com> wrote:
> sorry. please ignore. looks like the problem was not prefacing my boundaries with '--'
>
> max
> On Feb 14, 2011, at 5:57 PM, Max Cantor wrote:
>
>> Are there any issues with handling multi-part/form-data encoded POST request?
>>
>> Here are my request headers:
>>
>> headers: [("Host","192.168.0.187:6000"),("User-Agent","Consumer-iOS-Phonegap/1.0 CFNetwork/485.12.7 Darwin/10.4.0"),("Content-Length","618"),("Content-Type","multipart/form-data; boundary=BEGINBOUNDARYooooeflkscdlksjlkwrglk238sd723987sdiii"),("Accept","*/*"),("Accept-Language","en-us"),("Accept-Encoding","gzip, deflate"),("Cookie","_SESSION=TZsUfNyzruNnYeETdR/BB2Y/7ns5KRUVMgRkEkghOAo2lXbZ709DsPhclsOndiFmyEttOw5FHCfzW+MVM/eIfJQEruHeE3oFeSrrfdlmSEiZq3H7x+fPOyejZPq0Sd5x"),("Connection","keep-alive")]
>>
>> And what WAI gives back as the params:
>> ("geoLong","103.83032\r\nBEGINBOUNDARYooooeflkscdlksjlkwrglk238sd723987sdiii\r\nContent-Disposition: form-data; name=\"geoLat\"\r\nContent-Type: text/plain\r\n\r\n1.296149\r\nBEGINBOUNDARYooooeflkscdlksjlkwrglk238sd723987sdiii\r\nContent-Disposition: form-data; name=\"geoAccuracy\"\r\nContent-Type: text/plain\r\n\r\n65\r\nBEGINBOUNDARYooooeflkscdlksjlkwrglk238sd723987sdiii\r\nContent-Disposition: form-data; name=\"scannedTime\"\r\nContent-Type: text/plain\r\n\r\n1297677177.991\r\r\nBEGINBOUNDARYooooeflkscdlksjlkwrglk238sd723987sdiii--")
>>
>> Note that the entire request body is treated as one value to the first param instead of being broken up into multiple params. As an HTTP newbie, Its probable that I'm constructing the HTTP request wrong but I dont see what i'm doing wrong.
>>
>> Any help would be greatly appreciated.
>>
>> Max
>
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel
>
--
Gregory Collins <greg at gregorycollins.net>
More information about the web-devel
mailing list