try:res = requests.post('https://127.0.0.1:3000/', data={'data': data}, stream=True, timeout=(3.0, 7.5))except requests.exceptions.ConnectTimeout:print('Requests.POST Timeout ' + data)return(901)else:print('Success' + data)return(res.status_code)finally:pass
except requests.exceptions.RequestException as e:print(str(e))return(909)
httpConnectionPool(host='127.0.0.1', port=3000): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.httpConnection object at 0x000000000523AE48>: Failed to establish a new connection: [WinError 10061] 対象のコンピューターによって拒否されたため、接続できませんでした。'))
except requests.exceptions.ConnectionError:print('Requests.POST ConnectionError ' + data)return(901)