Learning DeadCL DeadCL Tutorials DeadCL Syntax DeadCL MBS

Walk throughs

Author Keys Conversations Libraries Arrays

  Network Status Community Hub Contact Us



Request body parameters (CHAD)

View Parcel (CHAD) overview


The basics

Request body parameters are used by CHAD (and Parcel) primarily to perform; POST, PUT & DELETE.

Request body parameters can be formatted as JSON or XML using one of the following;

JSON - type, JSON
XML - type, XML


Request body parameters mah be tied to a variable value (even if the corresponding value is fixed), by using a library & the following Syntax;

RV_ - Request body value

Unlike all the other parameter types discussed, request body parameters do not need to be explicitly linked to an endpoint - however request body parameters must be handed over to one.

Tied to an endpoint

Request body parameters can be tied to an endpoint within a (dedicated endpoint) Library.

In this example deadCL knows the values RV_user&RV_messageare always associated to;oracle-telemetry-uk
     
oracle-telemetry-uk; PARCEL- POSThttps://telemetry.uk-london-1.oraclecloud.com/ B JSON RV_user B JSON RV_message
You may review the syntax here.

Untied from an endpoint

Body request parameters can simply be listed and called upon by either a Conversation of Library.

Here we have two KC's configured to enable fast body requests by combining them within the Conversation or Library with a KC connected to the endpoint.
     
send-message; PARCEL- B JSON RV_user B JSON RV_message delete-user; PARCEL- B XML RV_user B XML RV_remove
You may review the syntax here.

Example - POST to the endpoint

The most common use for Request body parameters is to post the 'output' of a Conversation, in this simple example we'll going to send the following to a remote endpoint.

     
{ "sunrise" :"05:03:33 AM" "sunset" :"8:30:22 PM" }

Create parameters

First our request needs a value, for this example we'll use a dedicated Library and substitutions.
     
DAYLIGHT-CYCLE; PARCEL- B JSON RV_sunrise B JSON RV_sunset

Assign parameter values

Next we'll need to give QV_sunrise & QV_sunset a value, this is where either a linked Library or a Conversation comes into play.

This enable us to set the Body parameters POSTED as whatever $_sunrise & $_sunset are.
     
RV_sunrise; PARCEL- sunrise VAL_ $_sunrise RV_sunset; PARCEL- sunset VAL_ $_sunset

Configure the endpoint

We need to assign a KC to the endpoint.
     
DAY-API; PARCEL- POST https://api.weather/

POST the values

Finally we can send the parameters to the remote endpoint using the same basic principals of DRM.

With the inclusion of PARCEL- We can simply connect the parameter values and the endpoint (both are represented using KC's).
     
POST; PARCEL- DAYLIGHT-CYCLE -- DAY-API