Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

requests-to-curl

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

requests-to-curl

Library to convert python requests object to curl command.

  • 1.1.0
  • PyPI
  • Socket score

Maintainers
1

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 curl
>>> import requests
>>>
>>> response = requests.get("https://lulaolu.com")
>>>
>>> curl.parse(response)  # stdout
curl -X GET -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'User-Agent: python-requests/2.27.1' https://lulaolu.com:443/

If you want to get the curl string in the code project, use return_it

>>> c = curl.parse(response, return_it=True)
>>> print(c)

If you want to hide stdout, use print_it=False

>>> c = curl.parse(response, print_it=False)

You can also use r2c or requests_to_curl instead of curl

>>> import r2c
>>> r2c.parse(response)  # ok!
>>>
>>> import requests_to_curl
>>> requests_to_curl.parse(response)  # ok!

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc