src/Client.php
public function createRequest($method, $url = null, array $options = [])
    {
        $protocol_version = '1.1';
        $body = null;
        $headers = [];

        extract($options);

        $request = new Message\Request;

        $request->setMethod($method);
        $request->setUrl($url ? (string) $this->createUrl($url) : (string) $this->baseUrl);
        $request->setProtocolVersion($protocol_version);

        if (isset($body)) {
            $body = Stream::create($body);
            $request->setBody($body);
        }

        foreach ($headers as $key => $value) {
            $request->setHeader($key, $value);
        }

        return $request;
    }
public function createRequest($method, $url = null, array $options = [])
    {
        $protocol_version = '1.1';
        $body = null;
        $headers = [];

        extract($options);

        $request = new Message\Request;

        $request->setMethod($method);
        $request->setUrl($url ? (string) $this->createUrl($url) : (string) $this->baseUrl);
        $request->setProtocolVersion($protocol_version);

        if (isset($body)) {
            $body = Stream::create($body);
            $request->setBody($body);
        }

        foreach ($headers as $key => $value) {
            $request->setHeader($key, $value);
        }

        return $request;
    }
public function createRequest ( $ method , $ url = null , array $ options = [ ] ) { $ protocol_version = '1.1' ; $ body = null ; $ headers = [ ] ; extract ( $ options ) ; $ request = new Message \ Request ; $ request -> setMethod ( $ method ) ; $ request -> setUrl ( $ url ? ( string ) $ this -> createUrl ( $ url ) : ( string ) $ this -> baseUrl ) ; $ request -> setProtocolVersion ( $ protocol_version ) ; if ( isset ( $ body ) ) { $ body = Stream :: create ( $ body ) ; $ request -> setBody ( $ body ) ; } foreach ( $ headers as $ key => $ value ) { $ request -> setHeader ( $ key , $ value ) ; } return $ request ; }
Creates a request

@param string      $method
@param string|null $url
@param array       $options

@return Request
Creates a request