Skip to content Skip to sidebar Skip to footer

Getting 401 Unauthorized Error In Retrofit?

Error 401 unauthorized means request is denied due to invalid credentials. I am making request to https URL using retrofit and getting 401 unauthorized while doing curl https://ext

Solution 1:

It is possible that Retrofit does not support putting the username and password in the URL (due to security reasons). This kind of authentication is called Basic Authentication, and you can pass these parameters in an HTTP header as well.

Here's an article about how that can be done in Retrofit: https://futurestud.io/blog/android-basic-authentication-with-retrofit/

Post a Comment for "Getting 401 Unauthorized Error In Retrofit?"