You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently, the requests api of curl_cffi is missing prepare_request or httpx's build_request method. The method is useful to construct request object and ability to view or edit the request object before sending the request via Session().send or Client().send().
Describe the solution you'd like
httpx's build_request or requests' prepare_request method implemented in the requests api of curl_cffi
Describe alternatives you've considered
Using curl_cffi as requests adapter, so expected requests features are available.
Context
An example of the usefulness of build_request method in action.
client=requests.Session()
# build_request is httpx method, similar to prepare_requestreq=client.build_request(method: 'GET', url, headers, cookies, data)
# show request headersreq.headers# Update user-agent headerreq.headers['User-Agent'] ='my_web_crawler/0.1'# show request payloadreq.content# Update request payload using json stringdata= { 'hello': 'world'}
req.content=bytes(json.dumps(data), 'utf-8')
# Update request methodreq.method='POST'# send the built request after fixing the issueresp=client.send(req)
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, the
requests
api ofcurl_cffi
is missingprepare_request
or httpx'sbuild_request
method. The method is useful to construct request object and ability to view or edit the request object before sending the request viaSession().send
orClient().send()
.Describe the solution you'd like
httpx's
build_request
or requests'prepare_request
method implemented in the requests api of curl_cffiDescribe alternatives you've considered
Using
curl_cffi
asrequests
adapter, so expected requests features are available.Context
An example of the usefulness of
build_request
method in action.The text was updated successfully, but these errors were encountered: