Question

So this question has been asked numerous times in SO and elsewhere. On SO this is probably the question with the most comprehensive answers and comments.
REST, HTTP DELETE and parameters

In my scenario I want to add information to a delete request, not to identify the resource, but as meta data. Specifically, just some additional data the delete operation should record in a log.

Based on everything I've read putting any parameters as part of the DELETE request goes against best practices. What would be the best practice in this scenario?

Était-ce utile?

La solution

Metadata by its very name is data about a Resource. Using HTTP, such data belongs into HTTP headers.

Since the X- prefix is deprecated, just choose sensible header names for your metadata.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top