You are here

public function HttpStreamWrapper::request in Remote Stream Wrapper 8

Perform an HTTP request for the current URI.

Parameters

string $method: The HTTP method.

Return value

\Psr\Http\Message\ResponseInterface The HTTP response object.

Throws

\GuzzleHttp\Exception\GuzzleException

Overrides RemoteStreamWrapperInterface::request

1 call to HttpStreamWrapper::request()
HttpStreamWrapper::stream_open in src/StreamWrapper/HttpStreamWrapper.php

File

src/StreamWrapper/HttpStreamWrapper.php, line 294

Class

HttpStreamWrapper
HTTP(s) stream wrapper.

Namespace

Drupal\remote_stream_wrapper\StreamWrapper

Code

public function request($method = 'GET') {
  $response = $this
    ->getHttpClient()
    ->request($method, $this->uri, $this->config);
  if ($method !== 'HEAD') {
    $this->stream = $response
      ->getBody();
  }
  return $response;
}