Getting 401 unauthorized error in modification?

An error 401 unauthorizedmeans that the request is rejected due to invalid credentials. I make a request to the httpsURL using modification and getting it 401 unauthorizedwhen curl https://external:userName@api-staging.xyz.com/user/getit works it works fine for me (getting the expected result).

There is nothing wrong with implementing Retrofitin mine application, because other calls work fine. Is it something that I cannot pass such a URL to retrofit.setEndpoint?

+4
source share
1 answer

, Retrofit URL- (- ). Basic Authentication, HTTP-.

, Retrofit: https://futurestud.io/blog/android-basic-authentication-with-retrofit/

+4

Source: https://habr.com/ru/post/1613802/


All Articles