GuzzleHttp\Client::request PHP Method

request() public method

public request ( $method, $uri = '', array $options = [] )
$options array
    public function request($method, $uri = '', array $options = [])
    {
        $options[RequestOptions::SYNCHRONOUS] = true;
        return $this->requestAsync($method, $uri, $options)->wait();
    }

Usage Example

Example #1
1
 /**
  * @param Request $request
  * @return RawResponse
  * @throws \Exception
  */
 public function request(Request $request)
 {
     $res = $this->client->request('GET', $request->getUrl());
     if ($res->getStatusCode() == 200) {
         return new RawResponse((string) $res->getBody());
     }
     throw new \Exception('Error code', $res->getStatusCode());
 }
All Usage Examples Of GuzzleHttp\Client::request