I am using Jersey (1.18) to build a REST API for my WebApplication. In a part of my code I have the following snippet.
public static final ClientResponse.Status NO_CONTENT
204 No Content, see HTTP/1.1 documentation.
See this SO answer which says,
...204 means "No Content", meaning that the response contains no entity, but you put one in it. It's likely that Jersey is switching it to a 200 for you, which is basically identical to a 204 except that it contains a response entity.
Finally, you can get 204 responses very simply by a couple of built-in behaviors: void methods and null return values both map to a 204 response. Otherwise, simply return
In other words, if you want "NO_CONTENT" then don't include content in your response.