Request Class

Aurora\Http Namespace

Extends

Interfaces

  • I MessageInterface
  • I RequestInterface

Properties

method

Request method

protected $method = '': string

requestTarget

Request target

protected $requestTarget = '': string

uri

Request URI

protected $uri: \UriInterface

Constructor

__construct

Constructor

Parameters

  • mixed $method — HTTP method
  • mixed $uri — Request URI
  • array $headers — Request headers
  • mixed $body — Request body
  • mixed $protocolVersion — HTTP protocol version

Signature

public function __construct(mixed $method, mixed $uri, array $headers = [], mixed $body, mixed $protocolVersion = '1.1')

Methods

__construct

Constructor

Parameters

  • mixed $method — HTTP method
  • mixed $uri — Request URI
  • array $headers — Request headers
  • mixed $body — Request body
  • mixed $protocolVersion — HTTP protocol version

Signature

public function __construct(mixed $method, mixed $uri, array $headers = [], mixed $body, mixed $protocolVersion = '1.1')

getRequestTarget

Retrieves the message's request target

Return Value

  • string

Signature

public function getRequestTarget()

withRequestTarget

Return an instance with the specific request-target

Parameters

  • mixed $requestTarget

Return Value

  • \Request

Signature

public function withRequestTarget(mixed $requestTarget)

getMethod

Retrieves the HTTP method of the request

Return Value

  • string

Signature

public function getMethod()

withMethod

Return an instance with the provided HTTP method

Parameters

  • mixed $method — Case-sensitive method

Return Value

  • \Request

Signature

public function withMethod(mixed $method)

getUri

Retrieves the URI instance

Return Value

  • \UriInterface

Signature

public function getUri()

withUri

Returns an instance with the provided URI

Parameters

  • Psr\Http\Message\UriInterface $uri — New request URI to use
  • mixed $preserveHost — Preserve the original state of the Host header

Return Value

  • \Request

Signature

public function withUri(Psr\Http\Message\UriInterface $uri, mixed $preserveHost)

updateHostFromUri

Set the host header from the URI

Signature

protected function updateHostFromUri(): void

Go to top