2017 © Pedro Peláez
 

craft-plugin craft-fetch

Utilise the Guzzle HTTP client from within your Craft templates.

image

wyveo/craft-fetch

Utilise the Guzzle HTTP client from within your Craft templates.

  • Wednesday, May 9, 2018
  • by colinwilson
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 9 Versions
  • 33 % Grown

The README.md

icon, (*1)

Guzzle plugin for Craft CMS 3.x

Utilise the Guzzle HTTP client from within your Craft templates. (Forked from Luke Youell), (*2)

Requirements

This plugin requires Craft CMS 3.0.0 or later., (*3)

Installation

To install the plugin, follow these instructions., (*4)

  1. Open your terminal and go to your Craft project:, (*5)

    cd /path/to/project
  2. Then tell Composer to load the plugin:, (*6)

    composer require wyveo/craft-guzzle
  3. In the Control Panel, go to Settings → Plugins and click the "Install" button for Guzzle., (*7)

Using Guzzle

This plugin is built to work with the standard Guzzle request options, (*8)

Parameters

Parameter Example value
client { base_uri : 'https://gtmetrix.com', timeout : 10 }
method 'POST'
destination 'api/0.1/test'
options { auth : ['username', 'password'] }
format 'raw'

Example Usage

Request

{% set client = {
    base_uri : 'https://gtmetrix.com',
    timeout : 10
} %}

{% set options = {
    auth : ['username', 'password'],
    form_params : {
      url : 'https://www.google.co.uk'
    }
} %}

{% set request = guzzle(client, 'POST', 'api/0.1/test', options) %}

Response (successful)

{
   "statusCode":200,
   "reason":"OK",
   "body":{
      "credits_left":30,
      "test_id":"JDHFbrt7",
      "poll_state_url":"https:\/\/gtmetrix.com\/api\/0.1\/test\/JDHFbrt7"
   }
}

Response (error)

{
   "error":true,
   "reason":"Client error: `POST https:\/\/gtmetrix.com\/api\/0.1\/test` resulted in a `401 Authorization Required` response:\n{\u0022error\u0022:\u0022Invalid e-mail and\/or API key\u0022}\n\n"
}

Guzzle Roadmap

More features soon:, (*9)

Brought to you by wyveo, (*10)

The Versions

09/05 2018

v1.x-dev

1.9999999.9999999.9999999-dev

Utilise the Guzzle HTTP client from within your Craft templates.

  Sources   Download

MIT

The Requires

 

fetch cms guzzle craftcms craft-plugin craft

09/05 2018

1.1.3

1.1.3.0

Utilise the Guzzle HTTP client from within your Craft templates.

  Sources   Download

MIT

The Requires

 

fetch cms guzzle craftcms craft-plugin craft

28/04 2018

dev-raw-option

dev-raw-option

Utilise the Guzzle HTTP client from within your Craft templates.

  Sources   Download

MIT

The Requires

 

fetch cms guzzle craftcms craft-plugin craft

16/04 2018

1.1.2

1.1.2.0

Utilise the Guzzle HTTP client from within your Craft templates.

  Sources   Download

MIT

The Requires

 

fetch cms guzzle craftcms craft-plugin craft

26/02 2018

1.1.1

1.1.1.0

Utilise the Guzzle HTTP client from within your Craft templates.

  Sources   Download

MIT

The Requires

 

fetch cms guzzle craftcms craft-plugin craft

24/02 2018

1.1.0

1.1.0.0

Utilise the Guzzle HTTP client from within your Craft templates.

  Sources   Download

MIT

The Requires

 

fetch cms guzzle craftcms craft-plugin craft

08/02 2018

1.0.2

1.0.2.0

Utilise the Guzzle HTTP client from within your Craft templates.

  Sources   Download

MIT

The Requires

 

fetch cms guzzle craftcms craft-plugin craft

08/02 2018

1.0.1

1.0.1.0

Utilise the Guzzle HTTP client from within your Craft templates.

  Sources   Download

MIT

The Requires

 

fetch cms guzzle craftcms craft-plugin craft

15/01 2018

1.0.0

1.0.0.0

Utilise the Guzzle HTTP client from within your Craft templates.

  Sources   Download

MIT

The Requires

 

fetch cms guzzle craftcms craft-plugin craft