A
A
Alexqwerty2018-12-15 06:35:34
Java
Alexqwerty, 2018-12-15 06:35:34

How to properly pass password and login in header using Retrofit?

@Headers({"Authorization: Basic base64encode(<username>:<password>",
            "Content-Type: application/json",
            "Accept: application/json"})
    @POST("authorizations")
    Call<Auth> getUserRepos();

401 Unauthorized
{
"message": "Requires authentication",
"documentation_url": " https://developer.github.com/v3 "
}
Through RESTED it works where Basic Auth is, and through Retrofit apparently incorrect login and password transfer

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
aol-nnov, 2018-12-15
@aol-nnov

Well, in the 401 response there is a direct link where you can read what is done wrong! But no...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question