Android 改进GET参数错误

Android 改进GET参数错误,android,retrofit2,Android,Retrofit2,尽管如此,我在控制台上也没有例外,使用@PATH将参数传递给GET请求会破坏URL并生成404响应 @GET("user/authentif/{login}/{pwd}") Call<User> login(@Path("login") String login,@Path("pwd") String pwd); @GET(“user/authentif/{login}/{pwd}”) 调用login(@Path(“login”)字符串login,@Path(“pwd”)字

尽管如此,我在控制台上也没有例外,使用@PATH将参数传递给GET请求会破坏URL并生成404响应

  @GET("user/authentif/{login}/{pwd}")
  Call<User> login(@Path("login") String login,@Path("pwd") String pwd);
@GET(“user/authentif/{login}/{pwd}”)
调用login(@Path(“login”)字符串login,@Path(“pwd”)字符串pwd);
这就是电话

    apiService = RestService.createService(SolarAPIService.class);
    Call<User> call=apiService.login(email,pass);
    call.enqueue(new Callback<User>() {
        @Override
        public void onResponse(Call<User> call, Response<User> response) {
            mEmailView.setText(Integer.toString(response.code()));
        }
    }
);
apiService=RestService.createService(SolarAPIService.class);
Call Call=apiService.login(电子邮件、通行证);
call.enqueue(新回调(){
@凌驾
公共void onResponse(调用、响应){
mEmailView.setText(Integer.toString(response.code());
}
}
);

事实证明,我没有使用getText,而是使用getEditableText,因此mya参数为null,并导致404未找到错误

什么是错误?请发布完整代码解决方案的用户类。顺便说一句,您将在response.body()中获得用户对象;不是响应。代码();检查您的url。您可能输入了错误的url。也不要使用GET发送密码,这是不安全的。您确定您的电子邮件和密码传递不为null吗?我会检查电子邮件和密码,但当我不发送任何参数时,url本身工作正常。RetroFIT不允许您将null作为路径参数的值传递。这意味着服务器无法响应您的请求。我认为问题在于你的url,它可能不正确。