Library to convert python requests object to curl command.
Project description
RequestsToCurl
Convert python requests object to cURL command.
This repository is improved based on curlify. Since curlify does not seem to be updated anymore, no one responded to the PR I provided, so this repository was created.
Installation
pip install requests_to_curl
Usage
>>> import requests_to_curl
>>> import requests
>>> response = requests.get("https://lulaolu.com")
>>> requests_to_curl.parse(response)
"curl -X GET -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'User-Agent: python-requests/2.26.0' https://lulaolu.com:443/"
For convenience, you can also use r2c
or curl
instead of requests_to_curl
>>> import r2c
>>> r2c.parse(response) # ok!
>>>
>>> import curl
>>> curl.parse(response) # ok!
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
requests_to_curl-1.0.6.tar.gz
(5.0 kB
view hashes)
Built Distribution
Close
Hashes for requests_to_curl-1.0.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1843eb8d4d9dda620d4c741df1e6c2a67f997d044fdcbc44010330f258b114d |
|
MD5 | 4afa49306c9b7d79ed78b0fcbd11d2c3 |
|
BLAKE2b-256 | 7748351d9b6ac22e29aa56fb19da60a7a88560318f454e5b7e5599c1a0d59a08 |