The
Mapping Definitions section on the
REST Expose
Editor allows you to add, modify, or delete the custom node entries
added to an element of a HTTP request or response.
Note: The option of adding a
node is available for only for HTTP Header and it's children.
To add a node:
-
Select an element of a HTTP request or response.
-
Right-click the element, and then select Add node on the right-click context menu.
The Add Node dialog appears.
-
From the Type down-down, specify an element type for which you want
to create the node such as Query String Parameter, Header, Body, or Cookie. If
you select a PUT or POST verb on the Verb Association
section, the Type drop-down will also include the Form
Parameter type.
Note:
For a HTTP response, you can see only Header, Body, and Cookie in the
Type drop-down.
If you selected Header as Type, you can select content-type as the Header
name from the drop-down list.
-
In the Query String Parameter, Form
Parameter, Header, or
Cookie field, specify a value for the selected
element. For example, Query1 for Query String Parameter. The
Expression value field displays the specified
parameter value. For example,
${rest.queryparam['Query1']}.
The following example illustrates how to specify the
Cookie field (a CHAR or
LONGCHAR type). After choosing the Cookie field from
the drop-down list, you set the cookie (as per the HTTP cookie standard) as
follows:
Set-Cookie: HSID=AYQEVn.DKrdst; Domain=.foo.com; Path=/; Expires=Wed,
13-Jan-2021 22:23:01 GMT; HttpOnly
Set-Cookie is a directive for the browsers to store the
cookie. The Expression value field displays the
following parameter value: ${rest.cookie['Set-Cookie:
HSID=AYQEVn.DKrdst; Domain=.foo.com; Path=/; Expires=Wed, 13-Jan-2021
22:23:01 GMT; HttpOnly']}.
For more information on HTTP cookie specifications and setting a HTTP cookie,
see the online information sources.
Note: The field does not allow Java reserved words such as
INT, CHAR, and
BOOLEAN to be used as parameter names.
-
From the Name drop-down list in the Body
type, select a parameter. This list displays the input and output
parameters of the operation (ABL routine) that is associated with the REST
resource verb.
Note: The Name and JSON type fields appear when you
specify the node type as Body in the Type
drop-down.
-
From the JSON type drop-down, select a data type. This list displays
the OpenEdge supported JSON data types.
Note: The JSON type drop-down will be enabled only when you specify your own
parameter instead of selecting one of the parameters listed in the
drop-down.
You can see the added node entry under the selected HTTP request or response element. The
defined node context menu provides the options to edit (Edit
node) or delete (Delete) the node.