POST https://maxcvservices.dnb.com/rest/Authentication
x-dnb-user: MyUsername
x-dnb-pwd: MyPassword
is the D & B API documentation, and so I am trying to send a POST request using the python request module using the following line of code:
r = requests.post('https://maxcvservices.dnb.com/rest/Authentication',params={'x-dnb-user':userid,'x-dnb-pwd':pass})
The answer I get is Response [500]
and the content of the answer: error processing request\r\n
My question is, am I doing something wrong when sending the mail request and parameters, or is it a problem with the wrong username and password?
I feel the problem is how I pass the POST request, as the API responds with a separate 401 error for the wrong user id, pass.
{'connection': 'Keep-Alive',
'content-encoding': 'gzip',
'content-length': '46',
'content-type': 'text/plain',
'date': 'Sat, 26 Oct 2013 17:43:22 GMT',
'server': '',
'vary': 'Accept-Encoding',
'x-correlationid': 'Id-d4c07ad3526bff3a03fb742e 0'}
my answer header when i use:
r = requests.post('https://maxcvservices.dnb.com/rest/Authentication', headers={'x-dnb-user': 'userid', 'x-dnb-pwd': 'password'})
Random user ID and password.
But according to the API, I have to receive <Response [401]>. Instead, I get <Response [500]>.