我收到以下代码发送的某些请求时出错,我不知道原因。
private void DeActivateReq(String toolID, String token, String Childid) {
String url = "http://54.77.126.165:8080/api/v1/nutrients/" + toolID + "/deactivate.json?token=" + token + "&member_id=" + Childid;
StringRequest request = new StringRequest(Request.Method.GET, url, new Listener<String>() {
@Override
public void onResponse(String arg0) {
// TODO Auto-generated method stub
Log.e("response home", arg0 + "");
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e("response Errorhome", error + "");
if (error instanceof NoConnectionError) {
Log.d("NoConnectionError>>>>>>>>>", "NoConnectionError.......");
} else if (error instanceof AuthFailureError) {
Log.d("AuthFailureError>>>>>>>>>", "AuthFailureError.......");
} else if (error instanceof ServerError) {
Log.d("ServerError>>>>>>>>>", "ServerError.......");
} else if (error instanceof NetworkError) {
Log.d("NetworkError>>>>>>>>>", "NetworkError.......");
} else if (error instanceof ParseError) {
Log.d("ParseError>>>>>>>>>", "ParseError.......");
}else if (error instanceof TimeoutError) {
Log.d("TimeoutError>>>>>>>>>", "TimeoutError.......");
}
}
})
{
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
return Utils.createBasicAuthHeader(USERNAME, PASSWORD);
}
};
AppController.getInstance().addToRequestQueue(request, "DeActivateReq");
}
}
这里我的GET方法网址是完美的。我也是一个标题。在我的其他电话中它工作正常,但有些网址总是产生&#34;意外的响应代码404凌空&#34;服务器错误。 如果存在服务器错误,那么其他URL如何工作?
我做错了什么?