Input parameter attributes

A RESTful web service function can have input parameters.

The type of input parameter is defined by the ATTRIBUTES property. Table 1 lists the types. Additional parameters can be specified to provide a name or description; and depending on the parameter type, other attributes might identify the parameter as optional or specify a supported data format.

PUBLIC FUNCTION function-name(
    parameter-name INTEGER ATTRIBUTES(WSHeader, WSName = "id"),
    parameter-name INTEGER ATTRIBUTES(WSParam, WSDescription = "Value to be used")
    # ...
    )
    # ...
END FUNCTION
Table 1. Input parameter types
Parameter type Description Other attributes allowed
WSParam The parameter holds a template path.
WSHeader The parameter holds a custom header.
WSQuery The parameter holds a query path in the resource URL.
WSCookie The parameter holds a cookie.
Request body (without attributes WSHeader, WSQuery, WSCookie, or WSParam) The parameter is used for transferring data in the request body. Data can be JSON, XML, text, or a file type (such as an image).

Data of different MIME types can be sent in multiple parts of the same request. See Multipart requests or responses.

WSAttachment The parameter holds the path to a file for attachment.