= Accept Header

:Notice: Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at. http://www.apache.org/licenses/LICENSE-2.0 . Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR  CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.




The RO spec uses the standard `Accept` header for content negotiation, and defines its own "profile" for the standard representations; these take the form:

[source]
----
Accept: application/json;profile="urn:org.restfulobjects:repr-types/xxx"
----

where "xxx" varies by resource.
The detail can be found in link:https://www.restfulobjects.org/spec/1.0/section-a/chapter-02.html#_2-4-1-representationtype-profile-parameter[section 2.4.1] of the RO spec.

The "Isis" profile allows the client to request simplified representations for the most frequently accessed resources.
This is done by specifying an `Accept` header of:

[source]
----
Accept: application/json;profile="urn:org.apache.isis/v2"
----

Not every resource supports this header, but the most commonly accessed ones do.
In each case the server will set the
`Content-Type` header so that the client knows how to process the representation.

The link:https://www.youtube.com/watch?v=HMSqapQDY_4[screencast] demonstrates the feature.

The sections below explain in a little more detail what is returned when this profile is activated.


