Download the PHP package webignition/http-history-container without Composer
On this page you can find all versions of the php package webignition/http-history-container. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download webignition/http-history-container
More information about webignition/http-history-container
Files in webignition/http-history-container
Package http-history-container
Short Description A container for Guzzle history middleware
License MIT
Homepage https://github.com/webignition/http-history-container
Informations about the package http-history-container
Guzzle HTTP History Container
Helping you more easily test what your Guzzle HTTP client has been up to.
A container for Guzzle history middleware offering smashingly-nice access to:
- collections of HTTP transactions (requests plus responses)
- requests made
- responses received
- request URLs
Oh also logging. Really useful when your Guzzle client under test is not executing within the same thread as your tests.
Usage
Basic Usage
Details on Requests Sent
Details on Responses Received
Logging!
You may not be able to access your Guzzle history if the client under test is executing in a different thread from your tests.
A LoggableContainer
allows you to record transactions as they happen to whatever Psr\Log\LoggerInterface
instance you like.
The logging container wraps each HttpTransaction
in a LoggableTransaction
object which is
serialized to JSON and output as a debug message.
LoggableTransaction::fromJson()
lets you (in a somewhat slightly lossy manner) re-create
transactions object from logged messages.`
Logging Example
All versions of http-history-container with dependencies
ext-json Version *
guzzlehttp/psr7 Version ^2.1
psr/http-message Version ^1.0 || ^2.0
psr/log Version ^1.1 || ^2.0 || ^3.0