Volley
来源:互联网 发布:淘宝怎么进淘宝客 编辑:程序博客网 时间:2024/06/05 08:59
通过http://blog.csdn.net/ysh06201418/article/details/46443235学习
GET方式请求
//获取请求队列 RequestQueue mQueue = Volley.newRequestQueue(this); StringRequest stringRequest = new StringRequest("http://www.baidu.com", new Response.Listener<String>() { public void onResponse(String s) { Log.d("TAG", s); } }, new Response.ErrorListener() { public void onErrorResponse(VolleyError volleyError) { Log.d("TAG",volleyError.getMessage(),volleyError); } }); mQueue.add(stringRequest);
Post方式请求
//获取请求队列 RequestQueue requestQueue = Volley.newRequestQueue(this); StringRequest stringRequest = new StringRequest(Request.Method.POST, "www.baidu.com", new Response.Listener<String>() { @Override public void onResponse(String s) { Log.e("TAG",s); } }, new Response.ErrorListener() { public void onErrorResponse(VolleyError volleyError) { } }) { @Override protected Map<String, String> getParams() throws AuthFailureError { Map<String, String> map = new HashMap<String, String>(); map.put("Phone", "110"); return map; } }; requestQueue.add(stringRequest);
0 0
- Volley
- Volley
- volley
- volley
- Volley
- Volley
- volley
- Volley
- Volley
- volley
- Volley
- volley
- Volley
- Volley
- Volley
- volley
- Volley
- volley
- cordova入门——cordova环境配置
- RHEL6.6安装gitolite
- 图像的坐标变换
- 用Popup仿MessageBox 支持HTML语法混排
- windows安装TortoiseGit详细使用教程【基础篇】
- Volley
- 设计模式分类及介绍
- 添加重启和飞行模式
- Graham's Scan法求凸包
- 解析QT多线程程序详细设计之QObject可重入性 下篇
- 自定义dialog的方式,以及需要注意事项
- OpenCV : 基于切线方向的边缘增强算法
- react
- [Linux] 内核的 /proc 文件系统介绍及使用方法