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
File details
Details for the file requests_to_curl-1.0.5.tar.gz
.
File metadata
- Download URL: requests_to_curl-1.0.5.tar.gz
- Upload date:
- Size: 4.9 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 | a652abff1abd5066f5c1a9c33499a72639d63e8d0da94788e649f0bb83c03023 |
|
MD5 | f21c75291073ec65c6366787872395a6 |
|
BLAKE2b-256 | 0a61b8006b298a5d74697a1d5058d7c068cb6044594cf27af67899bf52de148d |