POST request in Python module not working properly

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]>.

+4
1

HTTP-; API:

D & B , , HTTP POST URL- , HTTP.

:

r = requests.post(
    'https://maxcvservices.dnb.com/rest/Authentication',
    headers={'x-dnb-user': userid, 'x-dnb-pwd': password})

, 401 ( ):

>>> import requests
>>> requests.__version__
'2.0.0'
>>> r = requests.post('https://maxcvservices.dnb.com/rest/Authentication',
...                   headers={'x-dnb-user': 'userid', 'x-dnb-pwd': 'password'})
>>> r
<Response [401]>
>>> r.headers['authorization']
'INVALID CREDENTIALS'

.

+5