Python Forum

Full Version: Error while connecting to web application
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

While connecting to web application getting below error and I have hide the credentials with dummy values.
Error message:
b'{"__type":"SerializationException"}'

`

import requests
import json
api_login = 'xxxxx
api_password = 'xxxx
CLIENT_ID = 'xxxx'
AUTHFLOW = 'xxxxx
url = 'https://xxxxxx.com
payload = {
   "AuthParameters" : {
      "USERNAME" : api_login,
      "PASSWORD" : api_password
   },
   "AuthFlow" : AUTHFLOW,
   "ClientId" : CLIENT_ID
}
# Adding empty header as parameters are being sent in payload
headers = {}
headers ={"X-Amz-Target" : "xxxxxxx",
          "Content-Type" : "xxxxx"
          }
print(payload)
r = requests.post(url, data=payload, headers=headers)
print(r.content)
`

Thanks in Advance.
Regards,
Harish
this doesn't look like error per se, it looks like JSON response that show something in your requests is not what it expects
Thanks for your response. I have replaced json with data like "data=payload". Now code able to connect and provide response with API Token.


Regards,
Harish
Hi Harish im sure we are both trying to acces the same web application as i am recieving the same aws response too, however im not recieving an api key when i change data to json. could you help me with this