Download the PHP package davidecesarano/embryo-client without Composer
On this page you can find all versions of the php package davidecesarano/embryo-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download davidecesarano/embryo-client
More information about davidecesarano/embryo-client
Files in davidecesarano/embryo-client
Package embryo-client
Short Description Simple PSR-18 HTTP Client implementation.
License MIT
Homepage https://github.com/davidecesarano/embryo-client
Informations about the package embryo-client
Embryo Client
Simple PSR-18 HTTP Client.
Requirements
- PHP >= 7.1
Installation
Using Composer:
Usage
You may use the get
, post
, put
, patch
, and delete
methods provided by the Http Client factory. These methods returns an instance of Psr\Http\Message\ResponseInterface
.
When making POST
, PUT
, and PATCH
requests you may send additional data to request with an array of data as their second argument.
Headers
Headers may be added to requests using the withHeaders
method. This method accepts an array of key / value pairs:
Bearer Token
If you would like to quickly add a bearer token to the request's Authorization
header, you may use the withToken
method:
Sending a raw request body
You may use the withJson
method if you want to provide a raw request body when making a request:
Attach file
If you want to send files, you may use the withFile
method. This method accepts the name of the field and file absolute path:
Timeout
With timeout
method you may to specify the maximum number of seconds to wait for a response:
All versions of embryo-client with dependencies
psr/http-message Version 1.0.1
psr/http-client Version 1.0.0
davidecesarano/embryo-http Version dev-master