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 c2v
or curl
instead of requests_to_curl
>>> import c2v
>>> c2v.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
File details
Details for the file requests_to_curl-1.0.3.tar.gz
.
File metadata
- Download URL: requests_to_curl-1.0.3.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d24ef83df1476e7035351c921b685b2cbf4b7fc83fc83e73f446a0cdbfca9efe |
|
MD5 | f5279ffe154c65bf9519f10047b85052 |
|
BLAKE2b-256 | 7d44b78734e2816acf4511948208d49113b1e57b47ac77e4f85a0294f52e01bc |