我在使用volley库发出网络请求时收到此错误,我已经按照这些链接安装了Android Volley - BasicNetwork.performRequest:意外的响应代码400和意外的响应代码404齐射,但它们都没有在我的情况下工作.这是我的请求代码
StringRequest stringRequest = new StringRequest(Request.Method.POST,AppConstants.LOG_IN_API , new Response.Listener<String>() {
@Override
public void onResponse(String response) {
Log.d("TAG", "Login Response: " + response.toString());
try {
JSONObject jsonObject = new JSONObject(response);
Log.v("USerid",""+jsonObject.getInt("userid"));
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError volleyError) {
System.out.println("volley Error ................."+volleyError);
}
}) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Log.v("getparams","Is called");
Map<String, String> params = new HashMap<String, String>();
params.put(AppConstants.USER_ID, "info@mindtears.com"); …Run Code Online (Sandbox Code Playgroud)