18
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

curlコマンドをrequestに変換してくれるサイト

Posted at

便利だったのでメモ
https://curl.trillworks.com/

仮に下記のようなcurlがあったとして

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

これを入れると下記に変換される

import requests

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

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

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

18
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
18
13

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?