Runs in this tab · nothing uploaded

EN

English

हिन्दीComing soon

EspañolComing soon

Pinned
HelpyTools

More

curl to Python requests

Convert a curl command into Python requests code, with headers, JSON body, form data, auth and cookies carried over.

Runs in your browserNothing uploadedWorks offline

Set up for this job. It runs on curl to fetch converter, where every option is there to change.

Loading curl to Python requestsRuns on this device. Nothing is uploaded.

Questions

What does the Python code need?

The requests library (pip install requests). The code imports it, sends the request and prints the status code and the response text.

How is a JSON body sent?

When the body is valid JSON it becomes a Python dict passed as json=, and requests sets the Content-Type header itself, so that header is left out of the headers dict.

What happens to -k, -m and -u?

-k becomes verify=False, -m becomes timeout= in seconds and -u becomes auth=(user, password). Options with no requests equivalent are listed in the notes.

Does it run the request?

No. It only rewrites the command as code. Nothing is sent, so tokens and cookies in the command stay on your device.

All developer tools

↑ ↓ move↵ openesc close

The tray

Install HelpyTools

Get HelpyTools on your home screen or Dock. It opens in its own window, and tools you have opened once keep working offline.