rpi-pico-micropython-esp8266-lib icon indicating copy to clipboard operation
rpi-pico-micropython-esp8266-lib copied to clipboard

Bugfix: Extracting data from byte response instead of string

Open mertaksoy opened this issue 3 years ago • 0 comments

The response of get call looks like this: {"key": "value}'

As you can see there is an apostrophe at the end. This comes because of the wrong conversion of byte to string. b'HTTP/1.1 200 OK\r\n ............ {"key": "value}'

after a lot of splits the apostrophe was forgotten.

This PR extracts data from the upstream without converting it to string.

After the response here, we could followings:

Parsing to string res = str(httpRes, 'utf-8') and then converting it to json json.loads(res)

mertaksoy avatar Nov 16 '21 20:11 mertaksoy