谁成功了?post、JsonObjectRequest 的方式,为啥不行额,看其他回答转成int也不行啊~求解
Map<String,String> hashMap = new HashMap<String, String>();
hashMap.put("phone", "1889568XXXX");
hashMap.put("key", "134d5a23a3381328621142f749250e1a");
JSONObject object = new JSONObject(hashMap);
JsonObjectRequest request = new JsonObjectRequest(Method.POST, url, object, new Listener<JSONObject>() {
@Override
public void onResponse(JSONObject arg0) {
Log.i("info", "Post_JsonObjectRequest成功回调:"+arg0.toString());
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError arg0) {
Log.i("info", "Post_JsonObjectRequest失败回调:"+arg0.toString());
}
});
request.setTag("Post_JsonObjectRequest");//设置Tag标签,方便进入请求队列后进行识别
MyApplication.getHttpQueues().add(request);