-
-
Notifications
You must be signed in to change notification settings - Fork 158
Expand file tree
/
Copy pathRequest.php
More file actions
48 lines (29 loc) · 1.08 KB
/
Request.php
File metadata and controls
48 lines (29 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
declare(strict_types=1);
namespace Tempest\Http;
use Tempest\Http\Cookie\Cookie;
interface Request
{
public Method $method { get; }
public string $uri { get; }
public ?string $raw { get; }
public array $body { get; }
public RequestHeaders $headers { get; }
public string $path { get; }
public array $query { get; }
/** @var \Tempest\Http\Upload[] $files */
public array $files { get; }
/** @var Cookie[] $cookies */
public array $cookies { get; }
public function has(string $key): bool;
public function hasBody(?string $key = null): bool;
public function hasQuery(string $key): bool;
public function get(string $key, mixed $default = null): mixed;
public function getSessionValue(string $name): mixed;
public function getCookie(string $name): ?Cookie;
/**
* Determines if the request's "Content-Type" header matches the given content type.
* If multiple content types are provided, the method returns true if any of them matches.
*/
public function accepts(ContentType ...$contentType): bool;
}