PHP Класс Clue\React\Buzz\Message\MessageFactory

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
body ( React\Stream\ReadableStreamInterface | string $body ) : StreamInterface Creates a new instance of StreamInterface for the given body contents
expandBase ( Psr\Http\Message\UriInterface $uri, Psr\Http\Message\UriInterface $base ) : Psr\Http\Message\UriInterface Resolves the given relative or absolute $uri by appending it behind $this base URI
request ( string $method, string | Psr\Http\Message\UriInterface $uri, array $headers = [], string | React\Stream\ReadableStreamInterface $content = '' ) : RequestInterface Creates a new instance of RequestInterface for the given request parameters
response ( string $version, integer $status, string $reason, array $headers = [], React\Stream\ReadableStreamInterface | string $body = '' ) : ResponseInterface Creates a new instance of ResponseInterface for the given response parameters
uri ( Psr\Http\Message\UriInterface | string $uri ) : Psr\Http\Message\UriInterface Creates a new instance of UriInterface for the given URI string or instance
uriRelative ( Psr\Http\Message\UriInterface $base, string $uri ) : Psr\Http\Message\UriInterface Creates a new instance of UriInterface for the given URI string relative to the given base URI

Описание методов

body() публичный Метод

Creates a new instance of StreamInterface for the given body contents
public body ( React\Stream\ReadableStreamInterface | string $body ) : StreamInterface
$body React\Stream\ReadableStreamInterface | string
Результат StreamInterface

expandBase() публичный Метод

The given $uri parameter can be either a relative or absolute URI and as such can not contain any URI template placeholders. As such, the outcome of this method represents a valid, absolute URI which will be returned as an instance implementing UriInterface. If the given $uri is a relative URI, it will simply be appended behind $base URI. If the given $uri is an absolute URI, it will simply be verified to be *below* the given $base URI.
См. также: Browser::resolve()
public expandBase ( Psr\Http\Message\UriInterface $uri, Psr\Http\Message\UriInterface $base ) : Psr\Http\Message\UriInterface
$uri Psr\Http\Message\UriInterface
$base Psr\Http\Message\UriInterface
Результат Psr\Http\Message\UriInterface

request() публичный Метод

Creates a new instance of RequestInterface for the given request parameters
public request ( string $method, string | Psr\Http\Message\UriInterface $uri, array $headers = [], string | React\Stream\ReadableStreamInterface $content = '' ) : RequestInterface
$method string
$uri string | Psr\Http\Message\UriInterface
$headers array
$content string | React\Stream\ReadableStreamInterface
Результат RequestInterface

response() публичный Метод

Creates a new instance of ResponseInterface for the given response parameters
public response ( string $version, integer $status, string $reason, array $headers = [], React\Stream\ReadableStreamInterface | string $body = '' ) : ResponseInterface
$version string
$status integer
$reason string
$headers array
$body React\Stream\ReadableStreamInterface | string
Результат ResponseInterface

uri() публичный Метод

Creates a new instance of UriInterface for the given URI string or instance
public uri ( Psr\Http\Message\UriInterface | string $uri ) : Psr\Http\Message\UriInterface
$uri Psr\Http\Message\UriInterface | string
Результат Psr\Http\Message\UriInterface

uriRelative() публичный Метод

Creates a new instance of UriInterface for the given URI string relative to the given base URI
public uriRelative ( Psr\Http\Message\UriInterface $base, string $uri ) : Psr\Http\Message\UriInterface
$base Psr\Http\Message\UriInterface
$uri string
Результат Psr\Http\Message\UriInterface