Python Forum
Error while connecting to web application
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error while connecting to web application
#1
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
Reply
#2
this doesn't look like error per se, it looks like JSON response that show something in your requests is not what it expects
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply
#3
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
Reply
#4
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
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020