Explain the use of charset parameter with Content-Type header: issue11082

This commit is contained in:
Senthil Kumaran 2012-03-15 18:15:34 -07:00
commit e53d977e80
3 changed files with 58 additions and 28 deletions

View file

@ -1172,8 +1172,9 @@ class AbstractHTTPHandler(BaseHandler):
if request.data is not None: # POST
data = request.data
if isinstance(data, str):
raise TypeError("POST data should be bytes"
" or an iterable of bytes. It cannot be str.")
msg = "POST data should be bytes or an iterable of bytes."\
"It cannot be str"
raise TypeError(msg)
if not request.has_header('Content-type'):
request.add_unredirected_header(
'Content-type',