Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix: Extracting data from byte response instead of string #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mertaksoy
Copy link

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant