Skip to content

Commit

Permalink
Solve the "POST data should be bytes, an iterable of bytes, or a file…
Browse files Browse the repository at this point in the history
… object. It cannot be of type str." issue thanks to matthewwall#15 (comment)
  • Loading branch information
bricebou committed Nov 12, 2020
1 parent 005b6ee commit a44822a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/user/netatmo.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,7 @@ def get_data(self, device_id=None, stale=300):
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))
Expand Down

0 comments on commit a44822a

Please sign in to comment.