REST API  15
REST API for Luna Network HSMs
All Files Pages
Headers

Headers are used by the server to process requests.

Content-Type

Content-Type defines the type of content the server should expect for a request so that it can be processed appropriately. You must specify this type when using PUT, PATCH and POST requests.

The template for the Content-Type header is defined as:

{
    "Content-Type" : "application/vnd.safenetinc.lunasa+{type};version={version}"
}

Types

Currently the REST API supports the following types:

  • json: sending json data to the server.
  • octet-stream: sending a stream of data to the server.
  • multipart: sending multipart data to the server.

Version

Version is a number defining the version of the resource to access. It is good practice to specify the current REST API version you wish to use; the behavior of your applications will remain consistent even if the resource changes in a later version. If you do not specify a version, REST API defaults to the newest version.

Accept-Type

The Accept-Type header entry is defined the same way as the Content-Type; it should be specified when using GET and DELETE requests.

NOTE: If both the Content-Type and Accept-Type header are given, the Content-Type will be used.

Important Points

  • It is not a mandate for all endpoints to support these values uniformly. Instead, the compatibility of these values depends on the nature of the input data.
  • Should any endpoint documentation explicitly specify the use of 'octet-stream' or 'multipart', then it is advisable to utilize these values exclusively with the content-type header.
  • If octet-stream or multipart is specified in the content-type, it is imperative that the input data be transmitted accordingly in the request body. Failure to adhere to this requirement will result in a FRAMEWORK_BAD_REQUEST response.