protected function httpRequest($url, $resource = '/', $content = null, $headers = [], $method = 'GET')
    {
        $request = new HttpRequest($method, $resource, $url);
        $response = new HttpResponse();

        $headers = array_merge(['User-Agent: WobbleCodeUserBundle'], $headers);

        $request->setHeaders($headers);
        $request->setContent($content);

        $client = new BuzzCUrl();
        $browser = new BuzzBrowser($client);

        $browser->send($request, $response);

        return $response;
    }
protected function httpRequest($url, $resource = '/', $content = null, $headers = [], $method = 'GET')
    {
        $request = new HttpRequest($method, $resource, $url);
        $response = new HttpResponse();

        $headers = array_merge(['User-Agent: WobbleCodeUserBundle'], $headers);

        $request->setHeaders($headers);
        $request->setContent($content);

        $client = new BuzzCUrl();
        $browser = new BuzzBrowser($client);

        $browser->send($request, $response);

        return $response;
    }
protected function httpRequest ( $ url , $ resource = '/' , $ content = null , $ headers = [ ] , $ method = 'GET' ) { $ request = new HttpRequest ( $ method , $ resource , $ url ) ; $ response = new HttpResponse ( ) ; $ headers = array_merge ( [ 'User-Agent: WobbleCodeUserBundle' ] , $ headers ) ; $ request -> setHeaders ( $ headers ) ; $ request -> setContent ( $ content ) ; $ client = new BuzzCUrl ( ) ; $ browser = new BuzzBrowser ( $ client ) ; $ browser -> send ( $ request , $ response ) ; return $ response ; }
Performs an HTTP request

@todo replace Buzz with Guzzle

@param string $url     The url to fetch
@param string $content The content of the request
@param array  $headers The headers of the request
@param string $method  The HTTP method to use

@return HttpMessageInterface The response content
Performs an HTTP request