Preconfiguration "REST API - Client - receive or send (GET, POST)"
REST API receive or send data by methods
GET or
POST
This preconfiguration can be activated when creating a new object (e.g. by
"New object ..." in the context menu of the object or by pressing the
Insert key after selecting the object).
This preconfiguration is included in the
"/ Communication / Protocols and other communications / REST API" group.
This preconfiguration can be created in the
PmaFolder,
PmaRoot or
PmaPrototype object.
- The preconfiguration is created including the panel (object of the
PmaPanel type) is functional also as
Web panel.
The
PmaFolder object has methods
RequestGet,
RequestPost and
UrlAddr. The
"UrlAddr" method returns the predefined URL address of the
REST API server.
The
"RequestGet" method has the
pars and
oRcv parameters. It means that the object that calls this method must have a user method "onReceive" created to process the incoming data. The first parameter will contain the requested URL address parameter and the second parameter will be used to send the reference of the calling object (
pMe).
The
"RequestPost" method has
pars and
sBody parameters. The first parameter again contains the URL addresss parameters and the second will be used to send the data.
Testing panel
PmaPanel allows to run methods
RequestGet or
RequestPost and display unprocessed received data.
These configurators can be set before the preconfiguration is created:
The name of created object | Name of the object created in the Pma object tree.
The maximum name length is 30 characters.
This is a system name, so it must contain only alphanumeric and must not contain any diacritics (i.e. national dependent characters), empty string, spaces and first character must not be a number.
Default: "REST_Client" |
|
URL address of the server | Full REST API server address without parameters |
URL address parameters (POST) | Parameters entered in the URL address, for example test=1&area=3 |
Enabling the test panel for the Web | |
---|