String URL = "http://192.168.2.100:8080/DemoRest/webapi/aliens";
RequestQueue requestQueue = Volley.newRequestQueue(this);
JsonObjectRequest jsonObjectRequest = new JsonObjectRequest(
Request.Method.GET,
URL,
null,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.e("Rest Response: ",response.toString());
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e("Rest Response: ",error.toString());
}
}
);
requestQueue.add(jsonObjectRequest);
在这里,我试图从我的休息api获取json数据..它在邮递员上正常工作.. 我试图与Android链接我正在收到此错误