createRequest($method, $url, null, null, $options); if (isset($options['stream'])) { if ($options['stream'] instanceof StreamRequestFactoryInterface) { return $options['stream']->fromRequest($request); } elseif ($options['stream'] == true) { $streamFactory = new PhpStreamRequestFactory(); return $streamFactory->fromRequest($request); } } return $request->send(); } /** * Send a GET request * * @param string $url URL of the request * @param array $options Array of request options * * @return \Guzzle\Http\Message\Response * @see Guzzle::request for a list of available options */ public static function get($url, $options = array()) { return self::request('GET', $url, $options); } /** * Send a HEAD request * * @param string $url URL of the request * @param array $options Array of request options * * @return \Guzzle\Http\Message\Response * @see Guzzle::request for a list of available options */ public static function head($url, $options = array()) { return self::request('HEAD', $url, $options); } /** * Send a DELETE request * * @param string $url URL of the request * @param array $options Array of request options * * @return \Guzzle\Http\Message\Response * @see Guzzle::request for a list of available options */ public static function delete($url, $options = array()) { return self::request('DELETE', $url, $options); } /** * Send a POST request * * @param string $url URL of the request * @param array $options Array of request options * * @return \Guzzle\Http\Message\Response * @see Guzzle::request for a list of available options */ public static function post($url, $options = array()) { return self::request('POST', $url, $options); } /** * Send a PUT request * * @param string $url URL of the request * @param array $options Array of request options * * @return \Guzzle\Http\Message\Response * @see Guzzle::request for a list of available options */ public static function put($url, $options = array()) { return self::request('PUT', $url, $options); } /** * Send a PATCH request * * @param string $url URL of the request * @param array $options Array of request options * * @return \Guzzle\Http\Message\Response * @see Guzzle::request for a list of available options */ public static function patch($url, $options = array()) { return self::request('PATCH', $url, $options); } /** * Send an OPTIONS request * * @param string $url URL of the request * @param array $options Array of request options * * @return \Guzzle\Http\Message\Response * @see Guzzle::request for a list of available options */ public static function options($url, $options = array()) { return self::request('OPTIONS', $url, $options); } }