Access to GET / POST variables, filecontainer etc.

Overview of Methods

\nn\t3::Request()->GP($varName = NULL);

Merge from $_GET and $_POST variables

@return array

\nn\t3::Request()->POST($url = '', $postData = [], $headers = []);

Sends a POST request (via CURL) to a server.

\nn\t3::Request()->POST( 'https://...', ['a'=>'123'] );
@return array

\nn\t3::Request()->files($path = NULL, $forceArray = false);

Get file uploads from $_FILES and normalize them.

Normalizes the following file upload variants. Removes empty file uploads from the array.

<input name="image" type="file" />
<input name="image[key]" type="file" />
<input name="images[]" type="file" multiple="1" />
<input name="images[key][]" type="file" multiple="1" />

Examples: Get ALL file info from $_FILES.

\nn\t3::Request()->files( true ); // force array

Get file info from tx_nnfesubmit_nnfesubmit[...].

\nn\t3::Request()->files('tx_nnfesubmit_nnfesubmit', true); // Force array

Only get files from tx_nnfesubmit_nnfesubmit[fal_media].

\nn\t3::Request()->files('tx_nnfesubmit_nnfesubmit.fal_media' );
\nn\t3::Request()->files('tx_nnfesubmit_nnfesubmit.fal_media', true ); // Force array
@return array


Read the authorization header from the request.


Important: If this doesn’t work, the following line is probably missing from the .htaccess is probably missing the following line:

# nnhelpers: use when running PHP in PHP CGI mode.
RewriteRule . - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
@return string


Read the Basic Authorization header from the request. If present, the username and password will be returned.

$credentials = \nn\t3::Request()->getBasicAuth(); // ['username'=>'...', 'password'=>'...']

Example call from a test script:

echo file_get_contents('');
@return array


Read the Bearer header. Used to transfer a JWT (Json Web Token), among other things.

@return string|null


Read the JWT (Json Web Token) from the request, validate it and, if the signature is validate the signature and return the payload of the JWT.

@return array|string

\nn\t3::Request()->getUri($varName = NULL);

return request URI. Basically the URL / GET string in the browser URL bar, which is stored in $_SERVER['REQUEST_URI']

@return string