Explain the use of charset parameter with Content-Type header. Issue11082

This commit is contained in:
Senthil Kumaran 2012-03-15 18:11:16 -07:00
parent 73277fe0eb
commit 6b3434ae04
3 changed files with 56 additions and 26 deletions

View file

@ -1062,8 +1062,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',