[PYTHON] A site that converts curl commands into requests

Note because it was convenient https://curl.trillworks.com/

If you have the following curl

curl -X POST 'https://example.com/' \
-H 'Content-Type: application/json' \
-d '{"key1": "value1", "key2": "value2"}'

If you put this in, it will be converted to the following

import requests

headers = {
    'Content-Type': 'application/json',
}

data = '{"key1": "value1", "key2": "value2"}'

response = requests.post('https://example.com/login', headers=headers, data=data)

Recommended Posts

A site that converts curl commands into requests
Map Creator, a service that converts latitude and history into URLs
A site that helped me study Django
I made a web application that converts photos into Van Gogh's style
Access a site with client certificate authentication with Requests
[Linux] A list of Linux commands that beginners should know
A simple Python HTTP server that supports Range Requests
Python that merges a lot of excel into one excel
A shell script that puts Webmin into Alpine Linux
[Python] A convenient library that converts kanji to hiragana