Просмотр исходного кода

Try data={} in stead of json={} in requests.post()

Foppe Hemminga 6 лет назад
Родитель
Сommit
097fcd2315
1 измененных файлов с 2 добавлено и 1 удалено
  1. 2 1
      view.py

+ 2 - 1
view.py

@@ -20,7 +20,8 @@ def broadcast(this_text):
         pprint(this_json)
         url = base_url+webhook
         print(url)
-        response = requests.post(url, json=this_json)
+        # response = requests.post(url, json=this_json)
+        response = requests.post(url, data=this_json)
         if response.status_code in [200, 204]:
             print("Webhook executed")
         else: