Skip to main content
added 31 characters in body
Source Link
Federico Piazza
  • 31.2k
  • 15
  • 91
  • 133

From your question, it looks like you are using @RequestBody for your @PostMapping but on your @DeleteMapping you are using @RequestParam.

It looksAlso you are invoking your DELETE api with request body instead of a url parameter. From your request info, I see:

DELETE /api/v1/wud/receiver?action=something HTTP/1.1 

YouBut you have to invoke your delete API like this:

DELETE /api/v1/wud/receiver?action=something&name=something Here ---------^^^^^ 

With curl you can use:

curl -X DELETE '{{url}}/api/v1/wud/receiver?action=something&name=something' 

On the other hand, if name param is not mandatory, then you can use:

@RequestParam(value = "name", required = false) String name 

From your question, it looks like you are using @RequestBody for your @PostMapping but on your @DeleteMapping you are using @RequestParam.

It looks you are invoking your DELETE api with request body instead of a url parameter:

DELETE /api/v1/wud/receiver?action=something HTTP/1.1 

You have to invoke your delete API like this:

DELETE /api/v1/wud/receiver?action=something&name=something Here ---------^^^^^ 

With curl you can use:

curl -X DELETE '{{url}}/api/v1/wud/receiver?action=something&name=something' 

On the other hand, if name param is not mandatory, then you can use:

@RequestParam(value = "name", required = false) String name 

From your question, it looks like you are using @RequestBody for your @PostMapping but on your @DeleteMapping you are using @RequestParam.

Also you are invoking your DELETE api with request body instead of a url parameter. From your request info, I see:

DELETE /api/v1/wud/receiver?action=something HTTP/1.1 

But you have to invoke your delete API like this:

DELETE /api/v1/wud/receiver?action=something&name=something Here ---------^^^^^ 

With curl you can use:

curl -X DELETE '{{url}}/api/v1/wud/receiver?action=something&name=something' 

On the other hand, if name param is not mandatory, then you can use:

@RequestParam(value = "name", required = false) String name 
added 138 characters in body
Source Link
Federico Piazza
  • 31.2k
  • 15
  • 91
  • 133

From your question, it looks like you are using @RequestBody for your @PostMapping but on your @DeleteMapping you are using @RequestParam.

It looks you are invoking your DELETE api with request body instead of a url parameter:

DELETE /api/v1/wud/receiver?action=something HTTP/1.1 

You should usehave to invoke your delete API like this:

DELETE /api/v1/wud/receiver?action=something&name=something Here ---------^^^^^ 

With curl you can use:

curl -X DELETE '{{url}}/api/v1/wud/receiver?action=something&name=something' 

On the other hand, if name param is not mandatory, then you can use:

@RequestParam(value = "name", required = false) String name 

From your question, it looks like you are using @RequestBody for your @PostMapping but on your @DeleteMapping you are using @RequestParam.

It looks you are invoking your DELETE api with request body instead of a url parameter:

DELETE /api/v1/wud/receiver?action=something HTTP/1.1 

You should use:

DELETE /api/v1/wud/receiver?action=something&name=something Here ---------^^^^^ 

From your question, it looks like you are using @RequestBody for your @PostMapping but on your @DeleteMapping you are using @RequestParam.

It looks you are invoking your DELETE api with request body instead of a url parameter:

DELETE /api/v1/wud/receiver?action=something HTTP/1.1 

You have to invoke your delete API like this:

DELETE /api/v1/wud/receiver?action=something&name=something Here ---------^^^^^ 

With curl you can use:

curl -X DELETE '{{url}}/api/v1/wud/receiver?action=something&name=something' 

On the other hand, if name param is not mandatory, then you can use:

@RequestParam(value = "name", required = false) String name 
Source Link
Federico Piazza
  • 31.2k
  • 15
  • 91
  • 133

From your question, it looks like you are using @RequestBody for your @PostMapping but on your @DeleteMapping you are using @RequestParam.

It looks you are invoking your DELETE api with request body instead of a url parameter:

DELETE /api/v1/wud/receiver?action=something HTTP/1.1 

You should use:

DELETE /api/v1/wud/receiver?action=something&name=something Here ---------^^^^^