4
votes

I have proprietary http based API to test from JMeter. Unfortunately some of the endpoints of the API are expecting http DELETE method with a request body (I know its questionable API design to use DELETE with request body, but I have no ability to change that API and need to test it).

How can I test it from JMeter? It seems that standard HttpRequest sampler silently ignores my body payload without any warnings. (When I try it in POSTMAN its sending a request body for DELETE method)

I did find an old JMeter plugin called HTTP Raw Request that somewhat helps but still doesn't auto-calculate "Content-Length:" http header for my body payload...so I have to do it manually for every test case - which is a pain for dynamically generated data payloads.

So my question still remains: How can I test HTTP DELETE with request body from JMeter?

Here is the screenshot: enter image description here

NOTE1: Starting from jMeter ver. 3.1 (see bugzilla #60358) it was fixed for Http GET request to be able to send body in the request...but DELETE was not added.

NOTE2: See bugzilla #61443 for the DELETE request with body.

NOTE3: I'm using client implementation called "Java".

1
Can you show how you configured the http request ? please show all tabs . thxUBIK LOAD PACK

1 Answers

3
votes

As per reference docs:

There are 2 implementations for http request sampler. The non default one called "Java" has this issue with not passing DELETE request body. Luckily the default implementation called "HttpClient4" that correctly passes request payload for DELETE operation as per JMeter data entry screen. To change implementations for http request sampler you have to go to "advanced" tab of the HTTP Request Sampler and select client implementation "HttpClient4" instead of "Java". Here is the screenshot: enter image description here

After that when executed it correctly sends request payload for DELETE operation. Here is the screenshot: enter image description here