teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

1

json_data の定義が漏れていたため追加いたしました。

2021/08/08 12:32

投稿

nuuuuben
nuuuuben

スコア0

title CHANGED
File without changes
body CHANGED
@@ -7,6 +7,11 @@
7
7
  ```
8
8
  import json
9
9
  import requests
10
+
11
+ json_data = {
12
+ 'datas': 'data'
13
+ }
14
+
10
15
  TO_URL = "http://hoge.com/hoge.php/"
11
16
  headers={'Content-Type': 'application/json'}
12
17
  response = requests.post( TO_URL, data=json.dumps(json_data),headers=headers)