20 RESPONSE SCENARIOS

When a domain type resource is invoked, one of several responses can occur. These can be distinguished by the HTTP status return code

  • 200 – Request succeeded, and generated a representation

  • 404 – Type or type member not found or not visible

  • 405 – Method not valid for the resource

  • 406 – Client accepts only media types not generated by resource.

In addition, a 401 code may be returned for any resource if the user’s credentials are invalid (that is, they have not authenticated themselves).

The following table indicates which of these status return codes may be generated for each resource:

Method Repr. 200 404 405 406

Domain Types

GET

y

y

y

y

Domain Type

GET

y

y

y

y

Type Property

GET

y

y

y

y

Type Collection

GET

y

y

y

y

Type Action

GET

y

y

y

y

Type Action Parameter

GET

y

y

y

y

Type Action Invoke

GET

y

y

y

y

For a given status code, the specific headers and body returned by these resources vary little between the different resources; this is especially so for the failure scenarios (4xx and 5xx).

This section (§D20) describes all the responses irrespective of resource called. Sections §D21 to §D27 identify the various request/response scenarios for each of the domain type resources. In each case they define the request URL, headers and body, and also identify the standard (success) response headers and body, if any.

20.1 Request succeeded, and generated a representation

For resources that return a body containing some representation.

20.1.1 Status code

  • 200 "OK"

20.1.2 Headers

  • Content-Length:

    • size of the entity body

  • Content-Type:

    • application/json;profile="…​/xxx"

      • where xxx indicates the representation type, §A2.4.1

  • Caching headers:

20.1.3 Body (representation)

The representation will depend on the resource being requested.

20.2 Type or type member not found or not visible

This is the response if a requested type or type member does not exist, or if the object/member exists but is not visible based on the current user’s credentials.

20.2.1 Status Code

  • 404 "Not found"

20.2.2 Headers

  • Warning

    • No such domain type {domainType}

    • No such property {propertyId}

    • No such collection {collectionId}

    • No such action {actionId}

    • No such action parameter {actionId}, {actionParamId}

20.2.3 Body

  • empty

20.3 Resource has invalid semantics for method called

20.3.1 Status code

  • 405 ("method not allowed")

20.3.2 Headers

  • Allow

    • GET

20.3.3 Body

  • empty

20.4 Not acceptable

The client has specified an Accept header that does not include a media type provided by the resource.

20.4.1 Status code

  • 406 ("not acceptable")

20.4.2 Headers

  • none

20.4.3 Body

  • empty