PHP 클래스 Clue\React\Buzz\Message\MessageFactory

파일 보기 프로젝트 열기: clue/buzz-react 1 사용 예제들

공개 메소드들

메소드 설명
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