Yesod/WAI and multipart/form-data encoded post requests

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

There are no *known* issues, though there could be unknown issues. Can
you send me the content of the request body itself? It looks like
you're missing some new lines after the boundaries, but I'm not sure.
Michael
On Mon, Feb 14, 2011 at 11:57 AM, Max Cantor
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@haskell.org http://www.haskell.org/mailman/listinfo/web-devel

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

The multipart/form-data spec sucks, doesn't it?!!
G
On Mon, Feb 14, 2011 at 2:26 AM, Max Cantor
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@haskell.org http://www.haskell.org/mailman/listinfo/web-devel
--
Gregory Collins

Haha... yes, it does. I filed a ticket a few months back on the web-encodings github repo only to have to go back in and say "Umm, yea, my screw up. Disregard." So don't feel _too_ bad there, Max. On Monday, February 14, 2011 at 10:33 AM, Gregory Collins wrote:
The multipart/form-data spec sucks, doesn't it?!!
G
On Mon, Feb 14, 2011 at 2:26 AM, Max Cantor
wrote: sorry. please ignore. looks like the problem was not prefacing my boundaries with '--'
participants (4)
-
Clint Moore
-
Gregory Collins
-
Max Cantor
-
Michael Snoyman