Volley-如何发送DELETE请求参数?安卓系统

时间:2018-07-31 23:08:36

标签: android request android-volley

我想通过发送具有以下参数的删除请求来删除某些内容:

gt_0 <- as.matrix(gt)

当我测试此代码时。它给我一个错误:

    RequestQueue queue = Volley.newRequestQueue(this);
    String url ="http://gama.mevzuattakip.com.tr/api/users/"+ID+"/devices";
    //String url = "http://httpbin.org/post";
    StringRequest deleteRequest = new StringRequest(Request.Method.DELETE, url,
            new Response.Listener<String>()
            {
                @Override
                public void onResponse(String response) {
                    // response
                    Log.d("Response", response);
                }
            },
            new Response.ErrorListener()
            {
                @Override
                public void onErrorResponse(VolleyError error) {
                    // error
                    // Log.d("Error.Response", response);
                }
            }
    ) {
        @Override
        protected Map<String, String> getParams()
        {
            Map<String, String> params = new HashMap<String, String>();

            Log.d("silinecekparametreler: ", verifycode + " - "+ token);
            params.put("verify_code", verifycode);
            params.put("token", token);
            params.put("user_id", userid);

            ID="-1";
            return params;
        }
    };
    queue.add(deleteRequest);

我如何在排球上使用参数?

0 个答案:

没有答案