I am getting FileNotFoundException
when making GET
call to REST API. Here HTTP status code I get is 403
.
For POST
call I get IOException : No authentication challenges found
, whereas I pass Authorization
header. Here I get HTTP status code 401
.
Look at my already asked question to see the code and logcat screen shot for POST
call.
Below I am attaching logcat screen shot for GET call :
Note :
1) I have tried using Authenticator
.
2) Tried different base64 flags such as NO_WRAP, URL_SAFE, DEFAULT.
3) My simple call to www.google.com
works.
4) When I log urlConnection.getErrorStream()
, last line in image is printed. I don't understand what is that and what does it mean. I have specified Content-type
to application/json
in header.
UPDATE : I tried using Burp
and found that headers "Accept", "Content-type" were different. I used the same as in iOS app. But still it does not work.
Things to note :
1) It always throws an Exception on the line in = urlConnection.getInputStream();
.
2) I logged few things and according to it, content-length is 114, which is not null. content-type is application/json; charser=utf-8
.