ContentNegotiationService
Generates a representation according to HTTP Accept
header of the request.
This idea is discussed in section 34.1 of theRestful Objects specv1.0.
The principal motivation is to allow more flexible representations to be generated for REST clients that (perhaps through their use of a certain JavaScript library, say) expect, or at least works best with, a certain style of representation.
API
interface ContentNegotiationService {
Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedObject objectAdapter) (1)
Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedProperty objectAndProperty) (2)
Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedCollection objectAndCollection) (3)
Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ManagedAction objectAndAction) (4)
Response.ResponseBuilder buildResponse(IResourceContext resourceContext, ObjectAndActionInvocation objectAndActionInvocation) (5)
}
1 | buildResponse(IResourceContext, ManagedObject)
Returns a representation of a single object. |
2 | buildResponse(IResourceContext, ManagedProperty)
Returns a representation of a single property of an object. |
3 | buildResponse(IResourceContext, ManagedCollection)
Returns a representation of a single collection of an object. |
4 | buildResponse(IResourceContext, ManagedAction)
Returns a representation of a single action (prompt) of an object. |
5 | buildResponse(IResourceContext, ObjectAndActionInvocation)
Returns a representation of a single action invocation of an object. |
Members
buildResponse(IResourceContext, ManagedObject)
Returns a representation of a single object.
By default this representation is as per section 14.4 of the RO spec, v1.0.
buildResponse(IResourceContext, ManagedProperty)
Returns a representation of a single property of an object.
By default this representation is as per section 16.4 of the RO spec, v1.0.
buildResponse(IResourceContext, ManagedCollection)
Returns a representation of a single collection of an object.
By default this representation is as per section 17.5 of the RO spec, v1.0.