How do I extract the response body from an httpx GET request? or What's the best way to access the ht

22 Replies, 1816 Views

"How do I extract the httpx get response body properly?"

Hey folks,

I'm kinda stuck here. Trying to get the httpx get response body from a simple request, but it’s not working as expected.

I’m doing something like:
```python
response = httpx.get("https://example.com")
print(response.body) # ??
```
But it’s not giving me the data I want. Am I missing something obvious?

Also, is there a difference between `.text`, `.content`, and `.body`? Which one should I use for plain text/json?

Thanks in advance!

(PS: If this is a dumb question, sorry—new to httpx!)

Messages In This Thread
How do I extract the response body from an httpx GET request? or What's the best way to access the ht - by - 03-08-2024, 12:12 AM



Users browsing this thread: 1 Guest(s)