質問

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?

役に立ちましたか?

解決

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.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top