Giter VIP home page Giter VIP logo

Comments (3)

florianpreusner avatar florianpreusner commented on June 28, 2024

Hi,

please provide more information:

  • which version of this bundle are you using?
  • how does your code look like?
  • please share your configuration of this bundle

Thanks.

from eightpointsguzzlebundle.

acmartinsalmeida avatar acmartinsalmeida commented on June 28, 2024

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

from eightpointsguzzlebundle.

florianpreusner avatar florianpreusner commented on June 28, 2024

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

from eightpointsguzzlebundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.