kushan.kjk kushan.kjk - 1 year ago 112
Linux Question

curl authentication failed in rest api

I'm currently trying to authenticate REST api using curl request.
but it gives error http 400 bad request for my curl request.

This is the curl request i'm used

curl -k -v -X POST -H "Content-Type: application/json" --data-binary @auth.txt https://example.com/vedsdk/Authorize/

auth.txt file contain credential for rest api.

auth.txt file contain


This Api_Account is a local account for REST Api platform.

Can anyone tell me where I'm wrong in this..

Answer Source

Found out the solution. add another back slash (\) in password

{ "Username":"Api_Acconut", "Password":"8+\\Kt\\P;Z" }

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download