我正在尝试使用Volley向我的服务器发送DELETE类型请求并向请求添加参数.到目前为止,我还没有这样做.
创建自定义请求并覆盖getParams()方法对我没有帮助,因为不会为DELETE类型请求调用此方法.
如何在Volley中为DELETE请求添加参数?
嗨我想使用标题和身体参数使用Volley向服务器发送删除请求.但我无法成功发送请求
我试过的
JSONObject jsonbObjj = new JSONObject();
try {
jsonbObjj.put("nombre", Integer.parseInt(no_of_addition
.getText().toString()));
jsonbObjj.put("cru", crue);
jsonbObjj.put("annee", 2010);
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
VolleyRequest mVolleyRequest = new VolleyRequest(
Method.DELETE, url, jsonbObjj,
new Listener<JSONObject>() {
@Override
public void onResponse(JSONObject jsonObject) {
// TODO Auto-generated method stub
if (pDialog != null) {
pDialog.dismiss();
}
Log.e("Server Response", "response = "
+ jsonObject.toString());
}
}, new ErrorListener() {
@Override
public void onErrorResponse(VolleyError arg0) {
// TODO Auto-generated method stub …Run Code Online (Sandbox Code Playgroud)