Skip to content

ServerRequest

Properties

attributes

private array $attributes

cookies

private array $cookies

files

private array $files

parsedBody

private null|array|object $parsedBody

parsedBodyIsSet

private bool $parsedBodyIsSet

query

private array $query

uploadedFileFactory

private \Psr\Http\Message\UploadedFileFactoryInterface $uploadedFileFactory

Methods

__construct

public __construct(\Swoole\Http\Request $swooleRequest, \Psr\Http\Message\UriFactoryInterface $uriFactory, \Psr\Http\Message\StreamFactoryInterface $streamFactory, \Psr\Http\Message\UploadedFileFactoryInterface $uploadedFileFactory): mixed

Parameters:

Parameter Type Description
$swooleRequest \Swoole\Http\Request
$uriFactory \Psr\Http\Message\UriFactoryInterface
$streamFactory \Psr\Http\Message\StreamFactoryInterface
$uploadedFileFactory \Psr\Http\Message\UploadedFileFactoryInterface

getServerParams

public getServerParams(): array

getCookieParams

public getCookieParams(): array

withCookieParams

public withCookieParams(array $cookies): \Psr\Http\Message\ServerRequestInterface

Parameters:

Parameter Type Description
$cookies array

getQueryParams

public getQueryParams(): array

withQueryParams

public withQueryParams(array $query): \Psr\Http\Message\ServerRequestInterface

Parameters:

Parameter Type Description
$query array

getUploadedFiles

public getUploadedFiles(): array

withUploadedFiles

public withUploadedFiles(array $uploadedFiles): \Psr\Http\Message\ServerRequestInterface

Parameters:

Parameter Type Description
$uploadedFiles array

getParsedBody

public getParsedBody(): object|array|null

withParsedBody

public withParsedBody(mixed $data): \Psr\Http\Message\ServerRequestInterface

Parameters:

Parameter Type Description
$data mixed

getAttributes

public getAttributes(): array

getAttribute

public getAttribute(string $name, mixed $default = null): mixed

Parameters:

Parameter Type Description
$name string
$default mixed

withAttribute

public withAttribute(string $name, mixed $value): \Psr\Http\Message\ServerRequestInterface

Parameters:

Parameter Type Description
$name string
$value mixed

withoutAttribute

public withoutAttribute(string $name): \Psr\Http\Message\ServerRequestInterface

Parameters:

Parameter Type Description
$name string

Inherited methods

__construct

public __construct(\Swoole\Http\Request $swooleRequest, \Psr\Http\Message\UriFactoryInterface $uriFactory, \Psr\Http\Message\StreamFactoryInterface $streamFactory): mixed

Parameters:

Parameter Type Description
$swooleRequest \Swoole\Http\Request
$uriFactory \Psr\Http\Message\UriFactoryInterface
$streamFactory \Psr\Http\Message\StreamFactoryInterface

getRequestTarget

public getRequestTarget(): string

withRequestTarget

public withRequestTarget(string $requestTarget): \Psr\Http\Message\RequestInterface

Parameters:

Parameter Type Description
$requestTarget string

getMethod

public getMethod(): string

withMethod

public withMethod(string $method): \Psr\Http\Message\RequestInterface

Parameters:

Parameter Type Description
$method string

getUri

public getUri(): \Psr\Http\Message\UriInterface

withUri

public withUri(\Psr\Http\Message\UriInterface $uri, bool $preserveHost = false): \Psr\Http\Message\RequestInterface

Parameters:

Parameter Type Description
$uri \Psr\Http\Message\UriInterface
$preserveHost bool

getProtocolVersion

public getProtocolVersion(): string

withProtocolVersion

public withProtocolVersion(string $version): \Psr\Http\Message\MessageInterface

Parameters:

Parameter Type Description
$version string

getHeaders

public getHeaders(): array

hasHeader

public hasHeader(mixed $name): bool

Parameters:

Parameter Type Description
$name mixed

getHeader

public getHeader(string $name): array

Parameters:

Parameter Type Description
$name string

getHeaderLine

public getHeaderLine(string $name): string

Parameters:

Parameter Type Description
$name string

withHeader

public withHeader(string $name, mixed $value): \Psr\Http\Message\MessageInterface

Parameters:

Parameter Type Description
$name string
$value mixed

withAddedHeader

public withAddedHeader(string $name, mixed $value): \Psr\Http\Message\MessageInterface

Parameters:

Parameter Type Description
$name string
$value mixed

withoutHeader

public withoutHeader(string $name): \Psr\Http\Message\MessageInterface

Parameters:

Parameter Type Description
$name string

getBody

public getBody(): \Psr\Http\Message\StreamInterface

withBody

public withBody(\Psr\Http\Message\StreamInterface $body): \Psr\Http\Message\MessageInterface

Parameters:

Parameter Type Description
$body \Psr\Http\Message\StreamInterface


Automatically generated on 2025-10-13