0
我正在使用Volley
的JsonArrayRequest
从我的网页获取JSON数据。 现在我已将基本 HTTP身份验证添加到我的网页。如何使用 HTTP验证码和Volley
? 如果我在网页中添加Digest HTTP Authentication,我该如何在android中处理它?如何使用HTTP Auth与Volley
我JsonArrayRequest
代码:
JsonArrayRequest loadMoreRequest = new JsonArrayRequest(url,new Response.Listener<JSONArray>()
{
@Override
public void onResponse(JSONArray response)
{
try
{
for (int i = 0; i < response.length(); i++)
{
JSONObject obj = response.getJSONObject(i);
//Some Logic
}
}
catch (JSONException e)
{
e.printStackTrace();
}
}
},
new Response.ErrorListener()
{
@Override
public void onErrorResponse(VolleyError error)
{
Toast.makeText(getActivity(), error.toString(),Toast.LENGTH_LONG).show();
}
});
requestQueue.add(loadMoreRequest);
你想找到这个? http://stackoverflow.com/questions/16817980/how-does-one-use-basic-authentication-with-volley-on-android – xxxzhi