Insert a document in HCP with python

0

Hello I hope you are well,

I have problems uploading a document to HCP (Hitachi)

this is the code that I'm occupying

import http.client
projectName = "Prueba"
hcpConn = ".prueba.local.mex"
headers = {'Authorization': 'HCP ZONud4M=:85e704e0f59a51b987f06485b5f90948'}
h = http.client.HTTPConnection(projectName + hcpConn)
_pt = "C:\Python.pdf"
h.request('PUT', "/rest" + _pt, headers=headers)

at the moment of executing it, the following error appears

  

File   "C: \ Users \ mxe01508121A \ AppData \ Local \ Programs \ Python \ Python36-32 \ lib \ socket.py",   line 743, in getaddrinfo       for res in _socket.getaddrinfo (host, port, family, type, proto, flags): socket.gaierror: [Errno 11004] getaddrinfo failed

I hope you can help me. Greetings!

    
asked by Memo 09.06.2017 в 18:40
source

1 answer

1
  • As the comment of @ patricio-moracho says you are connecting to a host that does not exist. Check your network properties and the connectivity (try to make ping for example)

  • If you are doing tests on your local machine, edit the file C:\Windows\System32\drivers\etc\host and add the line.

    127.0.0.1 test.local.mex.test

  • or whatever your server is called.

        
    answered by 09.06.2017 / 19:06
    source