Authorization for github.com on Android

前端 未结 3 1447
遇见更好的自我
遇见更好的自我 2021-01-01 06:23

Help me please. I make client for android for github.com api v3 and i have a trouble with authorization. (login = mytest12345 , pass = 12345test)

http://developer.g

3条回答
  •  伪装坚强ぢ
    2021-01-01 06:56

    def encoded = Base64.getEncoder().encodeToString((username + ":" + password).getBytes());
    request.setHeader("Authorization", "Basic " + encoded);
    

提交回复
热议问题