可以参考https://github.com/ngocchung/DeleteRequest长期的解决方案,因为它从文件看,但我没有测试过这一点。一个快速工作arrount是,作为post发出请求,然后用DELETE覆盖头部X-HTTP-Method-Override。
JsonObjectRequest jsonObjReq = new JsonObjectRequest(Method.POST, SERVER_URL,postPropertyJSONObject, responseListener, errorListener);
然后添加页眉这样
@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> headers = new HashMap<String, String>();
headers.put("X-HTTP-Method-Override", "DELETE");
headers.put("Accept", "application/json");
headers.put("Content-Type", "application/json");
return headers;
}
来源
2017-09-16 10:43:36
MSC
https://stackoverflow.com/questions/33553559/delete-request-with-header-and-parametes-volley/或使用get或交 –