I am using REST client for testing. I use exact same query, just changing method from POST to DELETE. I have same method in Spring Boot 2.0.1 - just changing annotation from @PostMapping to @DeleteMapping.
@DeleteMapping(value = "/receiver") public ResponseEntity<Response> doOperation(@RequestParam(value = "name") String name) { return new ResponseEntity<>(HttpStatus.OK); } As soon as I change to DELETE I am getting error:
"Required String parameter 'name' is not present" I have tested it with @PutMapping - works as well.
I am doing something wrong??
UPDATE 1
DELETE request:
DELETE /api/v1/wud/receiver?action=something HTTP/1.1 Cookie: PHPSESSID=e6b750be296f28174196817f126b367a Content-Type: application/x-www-form-urlencoded; charset=utf-8 Host: somehost:9443 Connection: close User-Agent: Paw/3.1.7 (Macintosh; OS X/10.13.4) GCDHTTPRequest Content-Length: 10 name=ASDEF response is mentioned error
POST request:
POST /api/v1/wud/receiver?action=something HTTP/1.1 Cookie: PHPSESSID=e6b750be296f28174196817f126b367a Content-Type: application/x-www-form-urlencoded; charset=utf-8 Host: somehost:9443 Connection: close User-Agent: Paw/3.1.7 (Macintosh; OS X/10.13.4) GCDHTTPRequest Content-Length: 10 name=ASDEF Response is 200
UPDATE 2
I was able to reproduce it in really simple setup using original spring example gs-rest-service. I have forked it on github HERE It's interesting that MockMvc test passes, but it doesn't work in reality.
I will fill a bug with Spring boot
TomcatEmbeddedServletContainerFactoryto create a connector withsetParseBodyMethods("POST,PUT,DELETE");