Closed acmartinsalmeida closed 9 years ago
Hi,
please provide more information:
Thanks.
HI and thanks
"eightpoints/guzzle-bundle": "dev-master"
config.yml
guzzle:
clients:
api_wiki:
base_url: "http://fr.wikipedia.org"
headers:
Accept: "application/json"
$client = $this->get('guzzle.client.api_wiki');
$request = $client->get("/w/api.php?action=query&prop=extracts&exintro=&format=json&continue=&titles=**whatever**");
$response = $request->send();
This bundle worked fine before guzzle 6 and 5.5 requirement
Thanks
Hi,
thanks for adding data. You don't have to use send() anymore. When using get() a response will be returned directly:
$client = $this->get('guzzle.client.api_wiki');
$response = $client->get('https://api.github.com/user', ['auth' => ['user', 'pass']]);
echo $response->getStatusCode();
// "200"
echo $response->getHeader('content-type');
// 'application/json; charset=utf8'
echo $response->getBody();
You can find more information in Guzzle documentation: http://docs.guzzlephp.org/en/latest/
Best regards Florian
I've updated to symfony 2.7 and PHP to 5.5 Get this error.
What i'm missing ?