mirror of
https://github.com/bricebou/weewx-netatmo.git
synced 2025-01-18 03:51:10 +01:00
Solve the "POST data should be bytes, an iterable of bytes, or a file object. It cannot be of type str." issue thanks to https://github.com/matthewwall/weewx-netatmo/issues/15#issuecomment-628994957
This commit is contained in:
parent
005b6ee943
commit
a44822acf5
1 changed files with 1 additions and 1 deletions
|
@ -518,7 +518,7 @@ class CloudClient(Collector):
|
|||
def post_request(url, params):
|
||||
# netatmo response body size is limited to 64K
|
||||
url = CloudClient.NETATMO_URL + url
|
||||
params = urlencode(params)
|
||||
params = urlencode(params).encode("utf-8")
|
||||
headers = {
|
||||
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8"}
|
||||
logdbg("url: %s data: %s hdr: %s" % (url, params, headers))
|
||||
|
|
Loading…
Reference in a new issue