WSOptional
Qualifies an attribute as optional in a REST function.
Syntax
WSOptional
Usage
You use this attribute to specify an attribute in a REST function as optional. You set the
WSOptional
attribute in the ATTRIBUTE()
clause of the
parameter.
WSOptional
can be set only with the following attributes:WSQuery
WSHeader
( input, output )WSCookie
WSOptional
is an optional attribute.
Example optional cookie
PUBLIC FUNCTION add(a INTEGER ATTRIBUTE(WSQuery),
b INTEGER ATTRIBUTE(WSHeader),
coef FLOAT ATTRIBUTE(WSCookie,WSOptional) )
ATTRIBUTES (WSGet,
WSPath='/add')
RETURNS (FLOAT)
# ... function code ...
RETURN (a + b)
END FUNCTION