Unexpected response code 404 volley
Asked Answered
C

0

4

I am receiving an error for some requests sent by the following code, and I don't know 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 my GET method URL is Perfect. I am putting a header also. In my other calls it's working fine but some URLs always yield "unexpected response code 404 volley" server errors. If there is a server error then how are other URLs working?

What am I doing wrong?

Commitment answered 27/6, 2015 at 3:37 Comment(3)
This may help you.......developer.salesforce.com/forums/?id=906F00000009EEKIA2Precipitant
this kind of que is already answred and this may help you [here][1] [1]: #26797465Precipitant
this kind of que is already answered and this may help you [here][1] [1]: #26797465Precipitant

© 2022 - 2024 — McMap. All rights reserved.