Skip to content

Commit

Permalink
Update user guide
Browse files Browse the repository at this point in the history
  • Loading branch information
natanfelles committed Jul 17, 2024
1 parent 559b97b commit fbf1bf0
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions guide/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ Add the following lines to test get Request information:
'host' => $request->getHeader('Host'),
'isSecure' => $request->isSecure(),
'isAjax' => $request->isAjax(),
'url' => $request->getUrl()->getAsString(),
'userAgent' => $request->getUserAgent()->getAsString(),
'url' => $request->getUrl()->toString(),
'userAgent' => $request->getUserAgent()->toString(),
]);
Now, lets try a call with Curl:
Expand Down Expand Up @@ -291,8 +291,9 @@ HTTP method is neither GET nor POST.
Request working with Arrays
###########################

The ``getGet``, ``getPost``, ``getFile``, ``getParsedBody``, ``getEnv`` and
``getServer`` methods can get data from arrays via strings with square brackets.
The ``getGet``, ``getPost``, ``getPut``, ``getPatch``, ``getFile``,
``getParsedBody``, ``getEnv`` and ``getServer`` methods can get data from arrays
via strings with square brackets.

For example, let's say ``$_POST`` equals the array below:

Expand Down Expand Up @@ -353,14 +354,14 @@ Response Headers
Headers can be set using the ``setHeader`` method, using a string in the first
parameter with the name of the header and in the second the value.

Also, you can use constants from the **Header** and **ResponseHeader** classes:
Also, you can use constants from the **ResponseHeader** class:

.. code-block:: php
use Framework\HTTP\Header;
use Framework\HTTP\ResponseHeader;
$response->setHeader('Content-Type', 'text/xml'); // static
$response->setHeader(Header::CONTENT_TYPE, 'text/xml'); // static
$response->setHeader(ResponseHeader::CONTENT_TYPE, 'text/xml'); // static
$response->setContentType('text/xml'); // static
Response Body
Expand Down Expand Up @@ -584,7 +585,7 @@ message can be saved.
<?php
require __DIR__ . '/header.php';
if ( ! $request->isPost() || ! $antiCsrf->verify()) {
if (!$request->isPost() || !$antiCsrf->verify()) {
exit ('Request is invalid.');
}
echo 'OK. Anti-CSRF is valid. You can save the message!';
Expand Down

0 comments on commit fbf1bf0

Please sign in to comment.