[web-devel] Problem with multipart request on yesod/wai
michael at snoyman.com
Fri Feb 25 11:34:04 CET 2011
It might be getting confused by the request headers. Could you send
those over as well? Also, what version of Yesod and wai-extra are you
On Fri, Feb 25, 2011 at 4:34 AM, Nubis <nubis at woobiz.com.ar> wrote:
> Hi guys,
> I'm developing a webservice in Yesod that needs to accept multipart POST's
> with image data in them. This webservice will be used mainly by mobile
> My handler that takes care of receiving the image works correctly when
> receiveng a POST crafted by google chrome (from a multipart/form-data
> encoded form), but when receiving a multipart post from a mobile device it
> fails to parse the multipart request arguments.
> I've setup a ruby on rails application with a similar handler, and both
> request from my mobile device and from a browser work, so I'm leaning
> towards thinking this is a yesod/wai issue.
> This is an excerpt from my handler, that I use to debug this:
> myHandler = do
> (params, files) <- runRequestBody
> liftIO $ putStrLn $ "params " ++ show params
> When requesting from the mobile device it just shows an empty list.
> I have dumps of both multipart requests, they seem pretty similar with the
> main differences being:
> * the multipart boundaries are longer in the browser request.
> * the request from the mobile device adds a trailing semicolon to the
> content-type of each part (except for the image)
> I attached the request that's not parsing correctly
> Any help will be greatly appreciated,
> thanks in advance!
> --nubis :)
> web-devel mailing list
> web-devel at haskell.org
More information about the web-devel