public function createRequest($url, $method = 'GET', array $headers = [], $body = null)
    {
        $headers = array_merge($headers, ['User-Agent' => strval($this->userAgent)]);
        return new Request($method, $url, $headers, $body);
    }
public function createRequest($url, $method = 'GET', array $headers = [], $body = null)
    {
        $headers = array_merge($headers, ['User-Agent' => strval($this->userAgent)]);
        return new Request($method, $url, $headers, $body);
    }
public function createRequest ( $ url , $ method = 'GET' , array $ headers = [ ] , $ body = null ) { $ headers = array_merge ( $ headers , [ 'User-Agent' => strval ( $ this -> userAgent ) ] ) ; return new Request ( $ method , $ url , $ headers , $ body ) ; }
Creates a request object.

@param string $url     URL
@param string $method  HTTP method

@return RequestInterface
Creates a request object .