Accept
is a standard header and is used in media type negotiation. The media type determines how a resource is represented over the wire. Ultimately, that is the API version - just representation of resource.
Accept
also has other useful semantics that a custom header doesn't. For example, Accept
allows for multiple, quality (e.g. weighted) media types. A client could ask for:
accept: application/vnd.com.myservice.v2+json;q=0.8, application/vnd.com.myservice.v1+json
This indicates to the server that the client prefers V2 of the JSON format with a 80% weight. If it's not available, then the client will also accept V1.
A media type can also use custom parameters. The following is also valid:
accept: application/json;q=0.8;v=2.0, application/json;v=1.0
This says the same thing, but uses a standard media type with a custom parameter instead of a custom media type. This approach is more generic and generally easier to consume in web stacks (in my experience).
I hope that helps.