Requests
Centum\Http\Request(
string $uri,
Centum\Http\Method $method = Centum\Http\Method::GET,
Centum\Interfaces\Http\DataInterface $data = null,
Centum\Interfaces\Http\HeadersInterface $headers = null,
Centum\Interfaces\Http\CookiesInterface $cookies = null,
Centum\Interfaces\Http\FilesInterface $files = null,
string $content = null
);
Centum\Http\Request
implements Centum\Interfaces\Http\RequestInterface
.
…
Request Factory
You can obtain a Request object made with global variables using the RequestFactory
:
use Centum\Http\RequestFactory;
$requestFactory = new RequestFactory();
$request = $requestFactory->createFromGlobals();
Due to constraints with HTML forms (which only create GET or POST requests), the Request Factory allows the method to be overwritten using a POST field of "_method"
.