我正在尝试登录。
该请求看起来像这样 $curl -u "username:PASSWORD"https://urlhere.com https://urlhere.com
我怎样才能使用改造使其发挥作用?
我尝试了一个授权标头,例如 request.addHeader("Authentication", username+":"+password);
有什么帮助吗?
你的问题不够明确。
我想这是基本的身份验证,你可以使用这样的东西
@FormUrlEncoded
@POST("/login") void login(
@Header("Authorization") String authorization,
Callback<?> callback
);
// later when you call it
public static String getBase64String(String value) throws UnsupportedEncodingException {
return Base64.encodeToString(value.getBytes("UTF-8"), Base64.NO_WRAP);
}
final String auth = "Basic " + getBase64String("user:password");
apiClient.login(auth, callback);
我希望这有帮助。 :)
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)