mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Explain the use of charset parameter with Content-Type header: issue11082
This commit is contained in:
commit
e53d977e80
3 changed files with 58 additions and 28 deletions
|
@ -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',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue