Iam在android中調用web服務。在這我要撥打的URL我沒有發送任何PARAMS到服務器,只需調用URL,BasicNetwork.performRequest:意外的響應代碼401 Android Volley庫
但它越來越像錯誤[10520] BasicNetwork.performRequest:意外的響應代碼401
我代碼是
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);
如何解決這個問題?
我打電話登錄Web服務與JSON PARAMS其工作正常後,登錄Web服務調用其不工作。任何猜測? – John 2015-04-06 09:45:17
我是否需要將曲奇添加到排球頭? – John 2015-04-06 09:46:04
是的,這些圖像需要身份驗證 – 2015-04-06 09:47:03