WSHead

In order to retrieve resource headers, you define the WSHead attribute.

Syntax

WSHead

Usage

You use this attribute to specify the action of the HTTP verb HEAD to return resource headers. You set the WSHead attribute in the ATTRIBUTES() clause of the function.

Example using WSHead to return resource headers

PUBLIC FUNCTION HeadUsers() 
   ATTRIBUTES(WSHead,
              WSPath = "/users",
              WSDescription = "Returns header of /users",
              WSThrows = "400:Invalid,404:not found")
   RETURNS(STRING ATTRIBUTE(WSHeader,
                            WSName = "Accept-Language",
                            WSMedia = "application/json") )
   DEFINE headers STRING

   # ... function code ...

   RETURN headers
END FUNCTION

In this example the REST function returns the resource headers.