Closed alx696 closed 3 weeks ago
The code example that you provided will not use line 110, so I believe changing things there will not make a difference.
I actually am not sure how .encode('utf-8')
could change the values that are sent by the mpy device in this example. Micropython does not even provide any other character encoding. Also, searching various sources, it seems that application/json
does not have a charset=
-parameter, as json content must be encoded as utf-8 anyways.
Did you store your source file in utf-8? If in doubt, you can try with this string: "esp32-\u4e2d\u6587-1"
, that makes sure that the string content is correct and ensures that there can be no encoding problem with the source file.
Thanks!
Must call
.encode('utf-8')
if body text contains Chinese:If not call
.encode('utf-8')
, workers can not receive full body text. The content will be garbled.Will the problem be solved after setting
; charset=UTF-8
to Content-Type ? https://github.com/micropython/micropython-lib/blob/master/python-ecosys/requests/requests/__init__.py#L110