Fast-android-networking: addHeaders() not working

Created on 26 Jul 2017  路  8Comments  路  Source: amitshekhariitbhu/Fast-Android-Networking

I have a web service that requires authorization and content type included in the header of every post request. using the .addHeaders("Authorization", TOKEN);
.addHeaders("content-type", "application/json");

Most helpful comment

its working. thanks

All 8 comments

it returns unauthorized access but accessing the same service using postman returns the expected response.

Try addHeader("Authorization", "Bearer " + TOKEN)

its still not working

Try setting content type like this setContentType("application/json; charset=utf-8")

its still not working

Same error here

Finally worked on my side; had unwanted chars, so did .addHeaders("Authorization", basicAuth.trim())

its working. thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MahdiPishguy picture MahdiPishguy  路  5Comments

hiteshrawat picture hiteshrawat  路  10Comments

everyline picture everyline  路  9Comments

MohadFarhan picture MohadFarhan  路  5Comments

salmansynergytop picture salmansynergytop  路  6Comments