2017 © Pedro Peláez
 

library guzzle-tools

A few tools for working with Guzzle

image

duncan3dc/guzzle-tools

A few tools for working with Guzzle

  • Monday, January 8, 2018
  • by duncan3dc
  • Repository
  • 1 Watchers
  • 0 Stars
  • 103 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 8 % Grown

The README.md

guzzle-tools

A PHP library offering some add-ons for Guzzle., (*1)

release build coverage, (*2)

Installation

The recommended method of installing this library is via Composer., (*3)

Run the following command from your project root:, (*4)

$ composer require duncan3dc/guzzle-tools

Quick Examples

Logging

When working with Guzzle I got bored of searching for the solution to output the request/response every time I wanted a quick debug, this library makes it easy:, (*5)

$client = \duncan3dc\Guzzle\Factory::getClient();

$client->request("GET", "http://example.com/");

Running the above would output this on the command line:, (*6)

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
GET / HTTP/1.1
User-Agent: GuzzleHttp/6.2.1 curl/7.47.0 PHP/7.1.0RC3
Host: example.com
--------------------------------------------------------------------------------
HTTP/1.1 200 OK
Cache-Control: max-age=604800
Content-Type: text/html
Date: Mon, 09 Jan 2017 14:42:17 GMT
Etag: "359670651+gzip+ident"
Expires: Mon, 16 Jan 2017 14:42:17 GMT
Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
Server: ECS (ewr/15BD)
Vary: Accept-Encoding
X-Cache: HIT
x-ec-custom-error: 1
Content-Length: 1270

<!doctype html>
<html>
<head>
    <title>Example Domain</title>
</head>
<body>


Example Domain

This domain is established to be used for illustrative examples in documents. You may use this domain in examples without prior coordination or asking for permission., (*7)

More information..., (*8)

</body> </html> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Request Building

As of version 6.0.0 Guzzle no longer offers a way to build a request instance to send later, this library provides a simple workaround:, (*9)

$request = \duncan3dc\Guzzle\Request::make("GET", "https://example.com/", [
    "query" =>  [
        "date"  =>  date("Y-m-d"),
    ],
]);

# There's also an alias on the main factory class
$request = \duncan3dc\Guzzle\Factory::request("GET", "https://example.com/");

Simple Requests

When all you need is a basic GET/POST, you can use the Http class:, (*10)

$response = \duncan3dc\Guzzle\Http::get("https://example.com/", [
    "date"  =>  date("Y-m-d"),
]);

$response = \duncan3dc\Guzzle\Http::post("https://example.com/", [
    "date"  =>  date("Y-m-d"),
]);

Changelog

A Changelog has been available since the beginning of time, (*11)

Where to get help

Found a bug? Got a question? Just not sure how something works?
Please create an issue and I'll do my best to help out.
Alternatively you can catch me on Twitter, (*12)

duncan3dc/guzzle-tools for enterprise

Available as part of the Tidelift Subscription, (*13)

The maintainers of duncan3dc/guzzle-tools and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. Learn more., (*14)

The Versions

08/01 2018

dev-master

9999999-dev https://github.com/duncan3dc/guzzle-tools

A few tools for working with Guzzle

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

debug log output guzzle

08/01 2018

0.3.0

0.3.0.0 https://github.com/duncan3dc/guzzle-tools

A few tools for working with Guzzle

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

debug log output guzzle

28/09 2017

dev-http-helper

dev-http-helper https://github.com/duncan3dc/guzzle-tools

A few tools for working with Guzzle

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

debug log output guzzle

27/08 2017

0.2.0

0.2.0.0 https://github.com/duncan3dc/guzzle-tools

A few tools for working with Guzzle

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

debug log output guzzle

08/02 2017

0.1.0

0.1.0.0 https://github.com/duncan3dc/guzzle-tools

A few tools for working with Guzzle

  Sources   Download

Apache-2.0

The Requires

 

The Development Requires

debug log output guzzle