Skip to content
Advertisement

Response from Postman shows 200, But Android returns 403

I was trying to develop an android app using Volley, The api I used to communicate is working fine when I checked with POSTMAN and retrieves 200 .

But when I use the same API in my App its returns me 403 “Forbidden” <p〉You don't have permission to access /API/checkPassOtp on this server.〈/p〉

Please find the screenshot.
ScreeShot

I have tried multiple solution for this issue, But nothing worked for me.

Can anyone please help me.

Attaching volley code and error response

JavaScript

Error response

Advertisement

Answer

Try to use

“Accept”, “application/json”

in your params (use both).

I have to use x-api-key when connecting with my company’s webserver, but I’m not sure if you’ll need it.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement