0

I am trying to run this curl request that is running successfully from my terminal in python:

curl -vvv -u <user>:<password> --upload-file filePath.zip http:/someHostostName:port/pathInNexus

in python i wrote:

import requests
files = {'file': open("filePath.zip", 'rb')}
url = "http:/someHostostName:port/pathInNexus"    
response = requests.post(url,files = files ,auth=(<user>, <password>)   

and I'm getting this error:

HTTPConnectionPool(host='ilcebln005.corp.amdocs.com', port=8081): Max retries exceeded with url: pathInNexus (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001C2715A7CC8>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

I'm fairly new to curl requests and im trying to automate it at Python

Mooncrater
  • 4,146
  • 4
  • 33
  • 62
  • It can not connect to the server. Happens with me when a site is accessible with VPN only. So in the case when the VPN is disconnected, the connection can not be made, and this exception is thrown – Mooncrater Nov 01 '20 at 11:54
  • I'm connect to the VPN, and because of that it is working when i run the curl. the request is look ok from python? maybe I'm missing something – Motti Gabai Nov 01 '20 at 12:03

0 Answers0