Volley:本地测试请求进入了Error,错误"no address associated with hostname"
String url = "http://xxx.xxx.xx/get?phone="+phone+"&key=xxx"; JsonObjectRequest request = new JsonObjectRequest(url, new Response.Listener<JSONObject>() { @Override public void onResponse(JSONObject response) { Toast.makeText(getContext(), "请求成功" + response.toString(), Toast.LENGTH_LONG).show(); } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { Toast.makeText(getContext(),"请求失败" + error.getMessage(), Toast.LENGTH_LONG).show(); } });
实在不知道哪错了,是我自己本地的问题吗?
"no address associated with hostname" 是服务器环境问题?