大家好
最近遇到一個問題
一個有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: