Using HTTP Vary header to decide on a strategy to process a request
Posted
by Jacques René Mesrine
on Stack Overflow
See other posts from Stack Overflow
or by Jacques René Mesrine
Published on 2010-03-30T09:48:39Z
Indexed on
2010/03/30
9:53 UTC
Read the original article
Hit count: 355
I have a specific REST endpoint that creates a topic in a forum; but I want to apply different strategies when processing the request. e.g. If client A makes the call, perform moderation. if client B makes the call, do something else. The easiest would be to add a query param for differentiation:
POST /resource?from=xyz
Another brilliant idea is to use the Vary HTTP header.
POST /resource
Vary: xyz
Any problems with this approach ?
© Stack Overflow or respective owner