ETag Support

The SDMConnectivity library provides APIs that allow ETags to be forwarded as request headers.

HTTP header fields are components of the message header for requests and responses. These fields define the the operating parameters of an HTTP transaction. The following header fields are applicable for ETag support.

ETag Header Fields
Header Fields Description
If-Match A client that has one or more ETags obtained from a resource, can verify that one of these ETags is current.
If-None-Match A client that has one or more ETags obtained from a resource can verify that none of these ETags is current.
If-Range A client that has an ETag that matches the current ETag of a resource, can request for the specified sub-range of the resource. This means that the client has a partial copy of an entity in its cache and can request to get the entire entity.
Note: If the backend system corresponds to Gateway, only the If-Match header field is supported.

Using ETags for HTTP Request Methods

ETags are forwarded as headers in HTTP request methods. Here are some examples for ETags with some of the commonly used request methods.

  • HTTP GET

    This method requests a representation of the specified resource. If used with an If-Match header and if the ETag of the entry resource matches the ETag at the server, the value of the specified resource on the server is returned. If it fails, the status code returned is 412 (Precondition Failed)

  • HTTP PUT

    This method uploads the representation of the specified resource. If used with an If-Match header and if the ETag of the entry resource matches the ETag at the server, the specified resource is uploaded at the server. If it fails, the status code returned is 412 (Precondition Failed).

  • HTTP DELETE

    This method deletes a specified resource. If used with an If-Match header and if the ETag of the entry resource matches the ETag at the server, the resource is deleted. If it fails, the status code returned is 412 (Precondition Failed).