Unexpected response code 404 volley

I am getting an error for some of the requests sent by the following code and I am not sure why.

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");
}

}

      

Here's my URL for the Perfect GET method. I also put the title. On my other calls, it works fine, but some urls always give server errors "unexpected 404 volley response code". If there is a server error, then how do the other urls work?

What am I doing wrong?

+3


source to share





All Articles