1

Possible Duplicate:
What's the correct encoding of HTTP get request strings?

One of my clients sent me they require HTTP requests to be encoded in ISO-8859-2,

so I wonder about what charset is used for HTTP communication, and if this request is somehow technicaly right.

Community
  • 1
  • 1
Marek Sebera
  • 39,650
  • 37
  • 158
  • 244

2 Answers2

0

Pure ASCII is all that's allowed in HTTP headers. But, as far as HTTP is concerned, anything goes in the request body of a POST. The headers and body are always separated by a blank line. A set of headers will normally identify the format of the content/body. Responses work the same way. However, HTML has some additional rules regarding what normally goes in a POST.

EDIT: Sorry, I missed the word 'GET' in your title. Might be nice to duplicate that in the body of your question.

At any rate, I believe I am correct in saying ONLY ASCII (ANSI X3.4-1986) is allowed in the headers of any HTTP request, GET or POST. So no, ISO-8859-2 requests are not strictly valid HTTP. That said, there's probably a way to escape the desired special characters in the query string if that's what you're really asking for here.

SOURCE: https://www.rfc-editor.org/rfc/rfc2616

Community
  • 1
  • 1
Brian McFarland
  • 9,052
  • 6
  • 38
  • 56
0

It depends. A "smart" server will always use percent-escaped UTF-8, but you can't rely on that.

Julian Reschke
  • 40,156
  • 8
  • 95
  • 98
  • 1
    and doesn't this depend on application running behind HTTP protocol? on which level is this considered? – Marek Sebera Oct 11 '11 at 15:38
  • @MarekSebera, the phrasing 'A "smart" server' does indeed mean this depends on "application running behind HTTP protocol". – bzlm Oct 12 '11 at 15:22