Skip to main content

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.4.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file requests_to_curl-1.0.4.tar.gz.

File metadata

  • Download URL: requests_to_curl-1.0.4.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

Hashes for requests_to_curl-1.0.4.tar.gz
Algorithm Hash digest
SHA256 d975087fe64f766c2605d554ddd5ab08b30a20d0d9117f54a73e31ee02b5ac60
MD5 b8749fc73353203358d9a6f92d47672a
BLAKE2b-256 dbef5800ba2d7f99c0046225ac1a1e7389b28a7ef1a349500b68b3b82a428df8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page