lexiforest / curl_cffi

Python binding for curl-impersonate fork via cffi. A http client that can impersonate browser tls/ja3/http2 fingerprints.
https://curl-cffi.readthedocs.io/
MIT License
2.44k stars 263 forks source link

[Feature] Add body to response.request #208

Open bernd-wechner opened 10 months ago

bernd-wechner commented 10 months ago

Is your feature request related to a problem? Please describe. Just a compatibility problem with the existing requests package in Python. If we POST a request then the response has a request object as an attribute and being a POST, that request object has a body attribute (being the posted data). I love this package, thanks enormously! This would help it slot in as a simple replacement for request, but may of course be one of many compatibility issues in the end. Just one I found when I swapped to this package in an existing script that POSTs and checks response.request.body.

Describe the solution you'd like That the request recorded against a response contain all the request attributes ...

Describe alternatives you've considered I just take it from the request I sent ;-)

perklet commented 10 months ago

If requests has it, we should add it. In the meanwhile, you need to keep a reference to the body variable by yourself.