Volley

 queue = Volley.newRequestQueue(this);
        StringRequest request1 = new StringRequest(Request.Method.POST, url_post, new Response.Listener<String>() {
            @Override
            public void onResponse(String response) {
                Log.e("MainActivity", response);
            }
        }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {


            }
        }) {
            @Override
            protected Map<String, String> getParams() throws AuthFailureError {
                Map<String, String> map = new HashMap<>();
                map.put("type", "top");
                map.put("key", "f7c582ae70a71ac819c00f2d5b54ab48");
                return map;
            }
        };
        queue.add(request1);

猜你喜欢

转载自blog.csdn.net/weixin_42376563/article/details/80657150
今日推荐