I'm considering the following two ways of identifying the tenant of a HTTP request, in a multi-tenant environment - hardcoding the tenant in the URI:
/{tenantUuid}/foos/{id}
Or passing the tenant in a custom HTTP Header, such as:
X-Auth-Token: 7d2f63fd-4dcc-4752-8e9b-1d08f989cc00"
(similar to: http://docs.openstack.org/api/quick-start/content/)
Note that the {id}
is unique across all tenants - so /{tenantUuid}/foos/{id}
will still uniquely identify a foo
Resource.
My question is - is it theoretically correct to use a Custom Header for this, or is the use of a Custom Header not restful. I am also aware that X-...
headers have been deprecated, but the question is ignoring that fact.
Thanks.