5

I've written quite a few extensions that need a way to fetch data from the web. Sometimes I've used file_get_contents sometimes cURL, other times I've sucked in (geddit!) Guzzle. Each of those has it's own requirements.

Just want to check that CiviCRM does not offer a service/wrapper for this that knows what is available? What's recommended?

4

2 Answers 2

6

CiviCRM core has bundled in Guzzle for a few years now (this was an old issue that got highlighted just now) - so Guzzle is the recommended approach

3

EDIT: See Eileen's updated answer above, this is now outdated.

As of 2021 CiviCRM bundles Guzzle!


I'm unsure what's recommended, but there are several patterns (at least) through the codebase:

1
  • I downvoted this because it was the right answer at the time but 2021 !== 2018
    – eileen
    Commented Aug 12, 2021 at 7:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.