문제

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