mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Explain the use of charset parameter with Content-Type header. Issue11082
This commit is contained in:
parent
73277fe0eb
commit
6b3434ae04
3 changed files with 56 additions and 26 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue