This is automatic generated document for things in Swow\Psr7\Client\Client class

Class Client

Constants

public DEFAULT_HTTP_PARSER_EVENTS = null public TYPE_TCP = null public TYPE_TCP4 = null public TYPE_TCP6 = null

Properties

protected $host

Methods

Method __construct

public function __construct ( int $type )

Method __debugInfo

public function __debugInfo ( ) : array

Method close

public function close ( ) : bool

Method connect

public function connect ( string $name , int $port , ?int $timeout ) : static

Method convertToClientException

protected function convertToClientException ( Exception $exception , RequestInterface $request ) : ClientExceptionInterface

Method enableCrypto

public function enableCrypto ( ?array $options ) : static

Method getReadTimeout

public function getReadTimeout ( ) : int

Method getSocket

public function getSocket ( ) : Socket

Method getSocketType

public function getSocketType ( ) : int

Method isEstablished

public function isEstablished ( ) : bool

Method recreate

public function recreate ( ?int $type ) : static

Method recvResponseEntity

public function recvResponseEntity ( ?int $timeout ) : ResponseEntity

Method sendEventStreamRequest

public function sendEventStreamRequest ( RequestInterface $request , ?int $timeout , int $readSize ) : Generator<int, \Swow\Psr7\Message\EventStreamEvent>

基于标准请求入口提供 SSE 事件流读取能力,支持任意 HTTP 方法(含 POST)。

Method sendPackedRequestAsync

public function sendPackedRequestAsync ( string $method , string $uri , array<string, array<string>> $headers , string $body , string $protocolVersion ) : static

Method sendRequest

public function sendRequest ( RequestInterface $request , ?int $timeout ) : ResponseInterface

Method setConnectTimeout

public function setConnectTimeout ( int $timeout ) : static

Method setHandshakeTimeout

public function setHandshakeTimeout ( int $timeout ) : static

Method setReadTimeout

public function setReadTimeout ( int $timeout ) : static

Method setTimeout

public function setTimeout ( int $timeout ) : static

Method setWriteTimeout

public function setWriteTimeout ( int $timeout ) : static

Method upgradeToWebSocket

public function upgradeToWebSocket ( RequestInterface $request ) : ResponseInterface

Copyright 2022 the Swow contributors