Skip to content

Response parser#149

Merged
lovelydinosaur merged 4 commits intodevfrom
response-parser
Mar 17, 2026
Merged

Response parser#149
lovelydinosaur merged 4 commits intodevfrom
response-parser

Conversation

@lovelydinosaur
Copy link
Contributor

@lovelydinosaur lovelydinosaur commented Mar 17, 2026

Parse response content into JSON, HTML, Text, or Binary...

>>> import httpx
>>> r = httpx.get('https://www.httpbin.org/json')
>>> r.content
<JSON {'slideshow': {'author': 'Yours Truly', 'date': 'date of publication', 'slides': [{'title': 'Wake up to WonderWidgets!', 'type': 'all'}, {'items': ['Why <em>WonderWidgets</em> are great', 'Who <em>buys</em> WonderWidgets'], 'title': 'Overview', 'type': 'all'}], 'title': 'Sample Slide Show'}}>
>>> r.content['slideshow']
{'author': 'Yours Truly', 'date': 'date of publication', 'slides': [{'title': 'Wake up to WonderWidgets!', 'type': 'all'}, {'items': ['Why <em>WonderWidgets</em> are great', 'Who <em>buys</em> WonderWidgets'], 'title': 'Overview', 'type': 'all'}], 'title': 'Sample Slide Show'}
>>> r.content['slideshow']['author']
'Yours Truly'

@lovelydinosaur lovelydinosaur merged commit 050fafe into dev Mar 17, 2026
5 checks passed
@lovelydinosaur lovelydinosaur deleted the response-parser branch March 17, 2026 15:59
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