web: encode to utf-8 before submitting
parent
0b5398ca04
commit
cd9f5ac8e2
2
web.py
2
web.py
|
@ -40,7 +40,7 @@ def head(uri):
|
||||||
def post(uri, query):
|
def post(uri, query):
|
||||||
if not uri.startswith('http'):
|
if not uri.startswith('http'):
|
||||||
return
|
return
|
||||||
data = urllib.parse.urlencode(query)
|
data = urllib.parse.urlencode(query).encode('utf-8')
|
||||||
u = urllib.request.urlopen(uri, data)
|
u = urllib.request.urlopen(uri, data)
|
||||||
bytes = u.read()
|
bytes = u.read()
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue