The request object in CHAPI was created to give the programmer an easy way to handle everything about HTTP requests.
Here the function available:
Check whether the current request was made via POST or not
true if the request was made via POST, false otherwise.
Return the HTTP method.
Returns a string with the HTTP method name.
Reads the input buffer.
Returns a string with the Input Stream contents.
Get a variable from the $_REQUEST superglobal.
Variable name to get from $_REQUEST.
Default to empty string.
Default value to return if the variable is not set. Default to empty string.
If name parameter is not passed, the function will return the whole $_REQUEST array.
If name parameter is passed, the function will return variable value or default value.
Get a variable from the $_GET superglobal.
Variable name to get from $_GET.
Default to empty string.
Default value to return if the variable is not set. Default to empty string.
If name parameter is not passed, the function will return the whole $_GET array.
If name parameter is passed, the function will return variable value or default value.
Get a variable from the $_POST superglobal.
Variable name to get from $_POST.
Default to empty string.
Default value to return if the variable is not set. Default to empty string.
If name parameter is not passed, the function will return the whole $_POST array.
If name parameter is passed, the function will return variable value or default value.
Get a variable from the $_SESSION superglobal.
Variable name to get from $_SESSION.
Default to empty string.
Default value to return if the variable is not set. Default to empty string.
If name parameter is not passed, the function will return the whole $_SESSION array.
If name parameter is passed, the function will return variable value or default value.
Get a variable from the $_FILES superglobal.
Variable name to get from $_FILES.
Default to empty string.
If name parameter is not passed, the function will return the whole $_FILES array.
If name parameter is passed, the function will return an array with file properties or null, if name is not set.
Get a variable from the $_SERVER superglobal.
Variable name to get from $_SERVER.
Default value to return if the variable is not set. Default to empty string.
The function will return variable value for name or default value.
Get a variable from the $_COOKIE superglobal.
Variable name to get from $_COOKIE.
Default value to return if the variable is not set. Default to empty string.
The function will return variable value for name or default value.
Check the $_REQUEST superglobal, with or without a specific item.
Item name.
true if the item was found (or the array is not empty), false otherwise.
Check the $_GET superglobal, with or without a specific item.
Item name.
true if the item was found (or the array is not empty), false otherwise.
Check the $_POST superglobal, with or without a specific item.
Item name.
true if the item was found (or the array is not empty), false otherwise.
Check the $_SESSION superglobal, with or without a specific item.
Item name.
true if the item was found (or the array is not empty), false otherwise.
Check the $_FILES superglobal, with or without a specific item.
Item name.
true if the item was found (or the array is not empty), false otherwise.
Check the $_SERVER superglobal, with or without a specific item.
Item name.
true if the item was found (or the array is not empty), false otherwise.
Check the $_COOKIE superglobal, with or without a specific item.
Item name.
true if the item was found (or the array is not empty), false otherwise.
Get authorization token from headers in different ways.
Bearer Token if found.
Sanitizes authorization header for use.
Clean bearer or null if not found.