Skip to content

Releases: gocanto/http-client

PHP Version + Quality tools

22 Dec 08:14
Compare
Choose a tag to compare

This release offers the following updates:

  • Drops support for PHP 7.4
  • Add code quality tools.
  • Migrates CI to GitHub actions.
  • General clean up.

Guzzle + PHP updates

12 Nov 08:40
9969385
Compare
Choose a tag to compare

Updates dependencies + code clean up.

Ref: #6

Add request headers on demand

14 Nov 03:53
8e9a4f5
Compare
Choose a tag to compare

Sometimes, we need to add headers to a given client instance based on dynamic data.

Such as requirement is not possible on the creation stage because we do not know what information we would be dealing with. Therefore, we need a mechanism to hook into and populate this data when needed.

This PR adds a new method withHeaders to allow on-demand headers values whenever needed.

For instance, you would be able to do something like so:

$client = new HttpClient;

$client->withHeaders([
      'X-GUS-1' => 'testing testing',
      'X-GUS-2' => 'testing testing',
      'X-GUS-3' => 'testing testing',
      'X-GUS-4' => 'testing testing',
])->request('GET', 'https://foo.com');

to populate as many headers as needed.

Note

You can still call other methods on the client because of the immutability nature of the given method.


You will be able to see the PR body here

First release

17 Oct 07:28
Compare
Choose a tag to compare
1.0.0

add examples