0

I am having a simple python script that does a post request to a .NET REST endpoint. No matter what timeout i set I see the request is getting timeout after 5 minutes.

Tried from multiple Linux machine and windows machine but still same error.

Code :

import requests
from datetime import datetime

url="https://test.com/GetData"
Body = "15"
header = { 'Content-Type': 'application/json' }

print("Body: %s" % Body)
print("Startime: %s" % datetime.now())
print("Running Post Request")

response = requests.post(url,data=Body,headers=header,timeout=1800)

print("EndTime : %s" % datetime.now())

Error :

urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='test.com', port=443): Max retries exceeded with url: /GetData (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)))

If I tried with CURL it works fine.

curl --location --request POST 'https://test.com/GetData' --header 'Content-Type: application/json' --data '7'

Can you please assist?

Jonathan Ciapetti
  • 1,261
  • 3
  • 11
  • 16
Marshall
  • 127
  • 3
  • 11

0 Answers0