import requests def post_data(url, word, thread): # POSTリクエストのペイロード payload = { 'word': word, 'thread': thread } # ヘッダーの設定(必要に応じて) headers = { 'Content-Type': 'application/json' } # POSTリクエストの送信 response = requests.post(url, json=payload, headers=headers) # レスポンスのステータスコードを表示 print(f'Status Code: {response.status_code}') # レスポンスの内容を表示 print(f'Response Content: {response.content.decode()}') return response # 使用例 #url = 'https://kenken999-nodex-n8n.hf.space/webhook-test/d2d0af6e-5c42-45b6-a923-3bd2d8520e3f' #word = 'example_word' #thread = 'example_thread' #post_data(url, word, thread)