/curlify3

yet another library to convert request object to curl command

Primary LanguagePython

yet another library to convert request object to curl command

PyPI PyPI

Support request's objects from:

  • requests
  • httpx
  • aiohttp server
  • starlette/fastapi

Installation

pip install curlify3

Example

from curlify3 import to_curl
import requests

response = requests.get("http://google.ru")
print(to_curl(response.request))
# curl -H 'user-agent: python-requests/2.32.3' -H 'accept-encoding: gzip, deflate' -H 'accept: */*' -H 'connection: keep-alive' http://www.google.ru/