Iam calling web service in android . in that i want to call the URL i am not sending any params to the server, just calling the URL ,
But its getting Error like [10520] BasicNetwork.performRequest: Unexpected response code 401
my code is
RequestQueue queue = Volley.newRequestQueue(getActivity());
JsonObjectRequest getRequest = new JsonObjectRequest(Request.Method.GET, Server.URL, null,
new Response.Listener<JSONObject>()
{
@Override
public void onResponse(JSONObject response) {
// display response
hideProgressDialog();
}
},
new Response.ErrorListener()
{
@Override
public void onErrorResponse(VolleyError error) {
hideProgressDialog();
}
}
);
// add it to the RequestQueue
queue.add(getRequest);
How to solve this?