This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set foo = "myKey" %} | |
{% set bar = "my value" %} | |
{# To name a hash key with the value of the foo variable, wrap the variable in parentheses: #} | |
{% set newThing = {(foo): bar} %} | |
{# Which is the same as #} | |
{% set newThing = {myKey: "my value"} %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Create Guzzle instance #} | |
{% set client = create({ | |
'class': 'GuzzleHttp\\Client' | |
}) %} | |
{# Send API request #} | |
{% set response = client.request('GET', 'https://jsonplaceholder.typicode.com/posts') %} | |
{# Check the response status #} | |
{% set status = response.getStatusCode() %} |