httpx icon indicating copy to clipboard operation
httpx copied to clipboard

Add `content_type` for Response

Open Sanchoyzer opened this issue 7 months ago • 2 comments
trafficstars

Summary

I would like to suggest adding a little syntax sugar. It might be more convenient to use response.content_type instead of response.headers.get("Content-Type"). I hope I haven't forgotten any places where changes need to be made

Checklist

  • [x] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • [x] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • [x] I've updated the documentation accordingly.

Sanchoyzer avatar Apr 20 '25 13:04 Sanchoyzer

Hey, @tomchristie , what do you think of this suggestion?

Sanchoyzer avatar May 09 '25 19:05 Sanchoyzer

I think this is not needed, but we can see what other maintainers think about it.

Kludex avatar May 30 '25 08:05 Kludex

what do you think of this suggestion?

I think this is not needed, but we can see what other maintainers think about it.

Indeed. Appreciate the interest tho.

lovelydinosaur avatar Sep 05 '25 14:09 lovelydinosaur