Multipart/form-data encoding

62 views
Skip to first unread message

Jørn Wildt

unread,
Jan 16, 2012, 5:06:02 AM1/16/12
to OpenRasta
I am debugging a client-side HTTP API that POSTs multipart/form-data
and want to know if OpenRasta supports charset specification in the
form elements? Like this:


--af52da52-3cdb-475f-95e3-9e0e835eea22
Content-Disposition: form-data; name="Age"
Context-Type: text/plain; charset=iso-8859-1

If I send Danish letters using iso-8859-1 encoding of the value then I
get nonsens in my server-side handler.

Thanks, Jørn

Sebastien Lambla

unread,
Jan 17, 2012, 3:13:35 AM1/17/12
to open...@googlegroups.com
Good question. There's a whole bunch of tests around that, so provided the .net culture matches the langid (here 8859-1) then it should work fine. The only thing we don't do by the spec is when there's nothing as browsers implemented something different and lie about their charset :)

Jørn Wildt

unread,
Jan 18, 2012, 9:24:46 AM1/18/12
to open...@googlegroups.com
Duh! Got it ... it was right there in front of everybody's eyes:

--af52da52-3cdb-475f-95e3-9e0e835eea22
Content-Disposition: form-data; name="Age"
Context-Type: text/plain; charset=iso-8859-1

Should have been "Content-Type" - not "Context-Type" ;-)

Now it works as expected.

/J�rn

Thanks, J�rn

Reply all
Reply to author
Forward
0 new messages