我很难把这个角色的电子邮件地址传进来
-
或者
_
当用户尝试注册时。以下是改装定义:
@Headers(API_KEY)
@FormUrlEncoded
@POST("signInUser")
Call<HttpResponseModel> signInUser(@Field(value ="userEmail", encoded = true) String userEmail,
@Field("userId") String userId,
@Field("userPasswordHash") String pwHash);
我的方法调用:
Call<HttpResponseModel> signInUser = retrofitApiInterface.signInUser(userEmail, userId, passWord);
signInUser.enqueue(new Callback<HttpResponseModel>() {
@Override
public void onResponse(@NonNull Call<HttpResponseModel> call, @NonNull Response<HttpResponseModel> response) {
..... //my implemenation
}
@Override
public void onFailure(@NonNull Call<HttpResponseModel> call, @NonNull Throwable t) {
listener.onFailure(); //exception gets thrown here
}
});
}
我得到的错误信息是:
com.google.gson.jsonsyntaxception:java.lang.IllegalStateException:应为BEGIN_对象,但在第1行第2列路径处为BEGIN_数组$
例如,引发异常的电子邮件:我将使用:my-name@email.com。
如果电子邮件地址是myname@email.com,则工作正常
调用值:
encodedNames = {Collections$UnmodifiableRandomAccessList@12120} size = 3
0 = "userEmail"
1 = "userId"
2 = "userPasswordHash"
encodedValues = {Collections$UnmodifiableRandomAccessList@12121} size = 3
0 = "my-name%40email.com"
1 = ""
2 = "mypassword"