DownloadHTTP request Payload
GET request
One can clean the URL by making the required changes in the web server .conf file.
Pagination in GET request
Requires __COUNT-SQL__ Sql in the configuration for GET request defaultPerpage=10
maxResultsPerPage=1000
>One need to urlencode orderBy value
POST, PUT, PATCH, and DELETE request
var payload = {
"key1": "value1",
"key2": "value2",
...
};
var payload = [
{
"key1": "value1",
"key2": "value2",
...
},
{
"key1": "value1",
"key2": "value2",
...
},
...
];
HttpRequest Variables
-
$activeRequestData\['userData'\] Session Data.
This remains same for every request and contains key's like id, group\_id, customer\_id
-
$activeRequestData\['routeParamArray'\] Data passed in URI.
Suppose our configured route is /{table:string}/{id:int} and we make an HTTP request for /tableName/1 then $activeRequestData\['routeParamArray'\] will hold these dynamic values as below.
-
$activeRequestData\['payload'\] request data.
For GET method, the $\_GET is the payload.
-
$activeRequestData\['__INSERT-ID__'\] Insert IDs Data as per configuration.
>For POST/PUT/PATCH/DELETE we perform both INSERT as well as UPDATE operation. The insertID contains the insert IDs of the executed INSERT queries.
-
$activeRequestData\['sqlResults'\] Hierarchy data.
>For GET method, one can use previous query results if configured to use hierarchy.
Hierarchy Configs
-
Config/Sql/CustomerDB/GET/Category.php
>In this file one can confirm how previous select data is used recursively in subQuery select as indicated by maintainHierarchy flag.
[
'column' => 'parent_id',
'activeRequestDataKey' => 'sqlResults',
'activeRequestDataKeySubKey' => 'return:id'
],
-
Config/Sql/CustomerDB/POST/Category.php .Here a request can handle the hierarchy for write operations.
return [
'__SQL__' => 'INSERT INTO `category` SET __SET__',
'__SET__' => [
'name' => ['payload', 'name'],
'parent_id' => ['custom', 0],
],
'__INSERT-ID__' => 'category:id',
'__SUB-CONFIG__' => [
'module1' => [
'__SQL__' => 'INSERT INTO `category` SET __SET__',
'__SET__' => [
'name' => ['payload', 'subname'],
'parent_id' => ['__INSERT-ID__', 'category:id'],
],
'__INSERT-ID__' => 'sub:id',
]
],
'__HIERARCHY__' => Constant::$TRUE
];
Hierarchy request
-
request - 1: Single object.
var payload = {
"name":"name",
"module1": {
"subname":"subname-value",
}
}
-
request - 2: Array of module1
var payload = {
"name":"name",
"module1":
[
{
"subname":"subname1",
},
{
"subname":"subname2",
},
...
]
}
-
request - 3: Array of payload and arrays of module1
var payload = [
{
"name":"name1",
"module1":
[
{
"subname":"subname1",
},
{
"subname":"subname2",
},
...
]
},
{
"name":"name2",
"module1":
[
{
"subname":"subname21",
},
{
"subname":"subname22",
},
...
]
},
...
]
Contributing
Issues and feature request are welcome.<br />
Feel free to share them on issues page
Author
-
Ramesh N. Jangid (Sharma)
Github: @polygoncoin
License
Copyright © 2026 Ramesh N. Jangid (Sharma).<br />
This project is MIT licensed.
|