2

I want to call webclient.delete(deleteBody) similar to POST.

WebClient client = WebClient.create(getUrl());
client = client.type("application/json").accept("application/json");
HTTPConduit conduit = WebClient.getConfig(client).getHttpConduit();
conduit.getClient().setReceiveTimeout(getApiTimeout());
Response resp = client.post(postData);

but there is no method which takes deleteBody.

I even use webclient.invoke("DELETE", deletBody) but this throws 500 HTTP error.

Here is my delete body:

{"password":"1ad1ad","username":11111111}

But I tried with curl command for DELETE its working:

curl -q -H "Accept: application/json" -H "Content-type: application/json" -X DELETE -d @del.json http://d.eze.cc/api/pd/xxxxx/DEL001234/
Alex
  • 4,844
  • 7
  • 44
  • 58
user1799236
  • 21
  • 1
  • 2

1 Answers1

2

You are right that the CXF WebClient does not support sending a body in a DELETE request.

  1. This is OK since it makes no sense to send a body with a DELETE request. See this question: Is an entity body allowed for an HTTP DELETE request?
  2. For the 500 error you get please take a look into the server log. How is the server side REST implemented?
Community
  • 1
  • 1