I have a lot of data that sits outside of Craft (the data is in MS SQL Server) and I plan on writing a simple .NET Service which will return JSON. I need to display this data but not sure on how to connect to a service using Craft CMS.

Are there any clients (plugins) which will connect to a service get the JSON data and display it?


Craft 2.x includes Guzzle 3 natively, so you could write a Craft plugin that uses it to consume your web service.

There are plenty of examples in the Guzzle 3 docs on how to do that (as well as in Craft itself).

You could also use something like this: https://straightupcraft.com/craft-plugins/guzzle

Which is a wrapper for Craft's Guzzle 3 you can use from a template.

  • This is super cool, didn't know that someone had exposed Guzzle to the template layer! Brad's suggestion to use a plugin (with controllers + services) is really solid—it's a great architecture. Most any Twig plugin that you might use to make an HTTP request will follow that pattern behind-the-scenes. – August Miller Aug 30 '16 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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