[問題] 同個網址,只能GET,無法POST
大家好
最近遇到一個問題
一個有GET和POST的應用程式網址
用requests寫
跑GET沒問題,但跑POST會失敗
有試過用其他語言寫,GET和POST都OK
所以應該可以排除網路環境issue
不曉得該如何解決...
程式碼如下面三行(網址隱碼):
import requests
my_data = {'msg': 'TEST'}
r = requests.post('***.***.**/***.********',data = my_data)
跑到timeout之後顯示的訊息如下(網址隱碼):
HTTPSConnectionPool(host='***.***.**', port=443): Max retries exceeded
with url:***.********
(Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at
0x0000021D6C3466D0>: Failed to establish a new connection: [WinError 10060] 連
線嘗試失敗,因為連線對象有一段時間並未正確回應,或是連線建立失敗,因為連線的主
機無法回應。'))
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
During handling of the above exception, another exception occurred:
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 210.71.216.244 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Python/M.1693194412.A.B78.html
推
08/29 18:30,
1年前
, 1F
08/29 18:30, 1F
→
08/30 00:05,
1年前
, 2F
08/30 00:05, 2F
→
08/30 14:18,
1年前
, 3F
08/30 14:18, 3F
→
08/30 14:18,
1年前
, 4F
08/30 14:18, 4F
推
08/31 01:59,
1年前
, 5F
08/31 01:59, 5F
Python 近期熱門文章
PTT數位生活區 即時熱門文章