0
我正在尝试请求服务器。当我通过Chrome扩展请求时,它正在工作。然而,它不能使用Volley。这是代码:Android - Volley - 请求GET使用标题不起作用
public void login(final String email, final String password) {
String url = BASE_URL + "login";
RequestQueue queue = Volley.newRequestQueue(mContext);
StringRequest stringRequest = new StringRequest(Request.Method.GET, url, this, this) {
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<>();
headers.put("email", email);
headers.put("password", password);
return headers;
}
};
queue.add(stringRequest);
}
错误侦听器被触发而不是成功侦听器。 我错过了什么吗?
没有工作......同样的问题... onErrorResponse被触发。 –
您能否请您发布排球错误stacktrace –
您能否请您发布排球错误stacktrace –