HttpClient — API
localzet\HTTP\Client
Section titled “localzet\HTTP\Client”function __construct(array $options = [])
function request(string $url, string $method = 'GET', array $data = [], array $headers = [], array $options = [])
function get(string $url, array $headers = [], $success = null, $error = null): mixed
function post(string $url, array $data = [], array $headers = [], $success = null, $error = null): mixed
function process(string $address): void
function recycleConnectionFromRequest(Request $request, $response = null): voidlocalzet\HTTP\Client\ConnectionPool
Section titled “localzet\HTTP\Client\ConnectionPool”function __construct(array $option = [])
function fetch(string $address, bool $ssl = false)
function recycle(AsyncTcpConnection $connection): void
function delete(AsyncTcpConnection $connection): void
function closeTimeoutConnection(): voidlocalzet\HTTP\Client\Emitter
Section titled “localzet\HTTP\Client\Emitter”function on(string $event_name, callable $listener): self
function once(string $event_name, callable $listener): self
function removeListener(string $event_name, callable $listener): self
function removeAllListeners(?string $event_name = null): self
function listeners(string $event_name): array
function emit(?string $event_name = null): boollocalzet\HTTP\Client\Request
Section titled “localzet\HTTP\Client\Request”function __construct(string $url)
function setOptions(array $options): static
function getOptions(): array
function on(string $event, callable $callback): static
function once(string $event, callable $callback): static
function emit(string $event): void
function removeListener(string $event, callable $listener): static
function removeAllListeners(?string $event = null): static
function listeners(string $event): static
function write(mixed $data = ''): static
function writeToResponse(string $buffer): void
function end(string $data = ''): void
function writeable(): bool
function doSend(): void
function onConnect(): void
function onMessage(AsyncTcpConnection $connection, string $recv_buffer): void
function handleData(AsyncTcpConnection $connection, string $data): void
function handleChunkedData(AsyncTcpConnection $connection, string $buffer): void
function onError(AsyncTcpConnection $connection, int $code, string $msg): void
function emitSuccess(): void
function emitError(Exception $e): void
static function redirect(Request $request, Response $response): bool|MessageInterface
function onUnexpectClose(): void
function detachConnection(): void
function getConnection(): ?AsyncTcpConnection
function attachConnection(AsyncTcpConnection $connection): staticlocalzet\HTTP\Client\Response
Section titled “localzet\HTTP\Client\Response”function __toString()localzet\HTTP\ParallelClient
Section titled “localzet\HTTP\ParallelClient”function push(string $url, array $options = []): void
function batch(array $set): void
function await(bool $errorThrow = false): array