0

Using OkHttp library I try to login to GitHub with a way, described in this topic -> Authorization for github.com on Android

body = new FormBody.Builder()
            .add("scopes", "public_repo")
            .add("note","admin script")
            .add("client_id","XXXXXXXX")
            .add("client_secret","XXXXXXXXXXXXXXX")
            .build();
    request = new Request.Builder()
            .url("https://api.github.com//authorizations")
            .addHeader("Authorization", "Basic XXXXXXXXXX")  //xxxx base64 login:password
            .post(body)
            .build();

But I've got html response with error

 {"message":"Not Found","documentation_url":"https://developer.github.com/v3"}
Community
  • 1
  • 1
Peter Parker
  • 560
  • 1
  • 5
  • 17

1 Answers1

0

The error is due the the double /. Fix this by removing the slash.

.url("https://api.github.com/authorizations")
bilalba
  • 783
  • 1
  • 7
  • 22