Giter VIP home page Giter VIP logo

Comments (3)

timmep90 avatar timmep90 commented on August 10, 2024

Seems like grambas/football-data is currently based on and older version of guzzlehttp.
I had the same issue (in guzzle 6.2) and found the solution within the ServiceProvider (FootballDataServiceProvider).

You should probably use an older version of guzzle or wait for an update.
(Not quite sure, but I think something around guzzle 5.3 should work.)
If you don't want to use any of these two options you can do the changes mentioned below. (But I don't recommend it!)

@grambas Are you currently using this container by yourself and if so: Which version of guzzle are you are running on?


If you don't want to wait or use an older version of guzzlehttp you can do the following changes.

Instead of
[...] 'base_url' => 'http://api.football-data.org/', [...]

it must be called
[...] 'base_uri' => 'http://api.football-data.org/', [...]

reference:
New documentation (Guzzle 6)
Old documentation (Guzzle 5.3)

Had problems using the method json() afterwards as well.
Used getBody()->getContents(); instead and it worked just fine.

For example to request the leagues, use this within the FootballData class:
$leagues = $this->client->get("{$v}/competitions")->getBody()->getContents();

from football-data.

Ferkl avatar Ferkl commented on August 10, 2024

Thank you @timmep90 for helping me out.

I'm using a older guzzle version now. But it would be nice if @grambas could have a look at it.

I'm new in using packages in laravel and need some more experience with it to handle such things with routine. ;)

from football-data.

grambas avatar grambas commented on August 10, 2024

I have just released first stable version. I changed and added some missing request with filters. All information you will find in readme file Now this package will work correctly with Guzzle >6.0. Just add "guzzlehttp/guzzle": "~6.0" to your composer.json

from football-data.

Related Issues (7)

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.