Using a REST client to execute a Data Object operation
- Last Updated: April 24, 2023
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
Once you have constructed the correct URI for the REST resource that represents a given Data Object operation, you can specify it as part of the HTTP request to execute the operation from a REST client, such as Postman. However, a REST client requires four basic pieces of information to send an HTTP request:
- URI — As described in the previous section
-
Media type — Always
application/jsonfor Data Object operations -
HTTP verb — As specified for each Data Object operation:
- Create —
POST - Read —
GET(with a query parameter in the URI—see Data Object URIs for testing resources from REST clients) - Update —
PUT(with no op-element in the URI—see Data Object URIs for testing resources from REST clients) - Delete —
DELETE - Submit —
PUT(with an op-element in the URI, similar to Invoke—see Data Object URIs for testing resources from REST clients) - Invoke —
PUT(for all Invoke operations, each of which is identified and distinguished from the others by the relative URI value annotated for the implementing ABL routine and specified as op-element in the URI—see Data Object URIs for testing resources from REST clients)
- Create —
-
Other HTTP request components — Especially
INPUTparameters to be included in the body of the HTTP request (described below)
Note that, other than the filter parameter
that is passed as the op-element in the URI of a Data
Object Read operation request (see see Data Object URIs for testing resources from REST clients), all other INPUT (and the input side of INPUT-OUTPUT) parameters passed to the implementing ABL routines for Data Object
operations are passed in the body of the HTTP request. This includes the JSON object for an
INPUT-OUTPUT temp-table or ProDataSet parameter that is
passed for the Data Object Create, Update, Delete, and Submit operations, and a JSON object
with properties for passing the values of any INPUT and
INPUT-OUTPUT parameters for Data Object Invoke operations.
For the REST client, the input JSON objects specified for relational data
must conform to the structure defined by OpenEdge for passing the JSON representations of
temp-tables and ProDataSets, as appropriate. For more information, see Use JSON with ABL Applications. Note that this structure is similar to the structure
used to return the data for a Data Object Read operation (GET). For an Invoke operation, the property names in the simple JSON object must
have the same case-sensitive names as the corresponding parameters defined in the implementing
ABL routines.
Note also that for the Data Object Create, Update, and Delete operations, all of which have the same type of input JSON object for relational data, only the HTTP verb specified for the HTTP request distinguishes these Data Object operations from each other.