Skip to content

Releases: PhpGt/Fetch

New `awaitFetch` method

31 Jan 09:54
dc0ebc6
Compare
Choose a tag to compare

What's Changed

Full Changelog: v1.1.1...v1.2.0

Refactor web APIs to phpgt/http

11 Jul 18:08
44df571
Compare
Choose a tag to compare

This release refactors the web API classes used in this repository into the upstream phpgt/http library.

What's Changed

New Contributors

Full Changelog: v1.1.0...v1.1.1

Replaced async functionality

20 Jan 17:50
59a3d1c
Compare
Choose a tag to compare

This feature removes any third part implementations of the underlying Promise implementation.

What's Changed

Full Changelog: v1.0.1...v1.1.0

JSON improvements

29 Dec 20:55
927f847
Compare
Choose a tag to compare

Type-safe functions have been added to the Json object, along with enhanced iterator functions. This release is being made ready for the work starting on v2, where PhpGt's Async functions are integrated as opposed to React's.

Stable release

20 Jun 15:08
Compare
Choose a tag to compare

The last few weeks have seen many PHP.Gt repositories reach stable release, and as Fetch was dependent on a few core repositories, is has finally got a clear dependency tree of stable repositories through Composer.

Blob response type

22 May 08:41
Compare
Choose a tag to compare
Blob response type Pre-release
Pre-release

The 0.7.x releases mark the final steps towards stable release, implementing the other types of response, starting with the blob type.

Implementing the different types has outlined a potential new repository for PhpGt: WebAPI, which would be a collection of the standard objects that make up the W3C WebAPI, such as Blob, ArrayBuffer, etc. For now, these exist within Fetch, because there doesn't seem to be much use of reusing them on the server elsewhere... yet.

CURLOPT from RequestInterface

22 May 08:37
122111b
Compare
Choose a tag to compare
Pre-release

Calling the fetch method with a PSR-7 RequestInterface is now possible, with the library converting the properties of the Request object to the corresponding CURLOPT settings.

Resolution of JSON

21 Feb 15:55
Compare
Choose a tag to compare
Resolution of JSON Pre-release
Pre-release

Along with some working example code in /example, the main feature added to this development release is the ability to resolve JSON responses, as with the client-side fetch API.

This means that if you are expecting a response to be a JSON document, returning $response->json() will resolve a promise that will receive the pre-decoded JSON object for use.

Check out example/02-post-request.php for example code showcasing this.

Send useragent by default

20 Feb 10:35
Compare
Choose a tag to compare
Pre-release

While using this library in real world tests, it seems that a lot of APIs (Github's for example) require a useragent header to be sent with a request.

It's possible to set your own headers, but this shouldn't be a required step, as just using curl on the commandline or from PHP automatically sets their default useragent, so now this library does too.

Recursive promise fulfilment

09 Dec 20:22
Compare
Choose a tag to compare
Pre-release

The issue that was being tracked by #28 is now resolved. The response of a promise's fulfilment could also be a promise, which was in turn not being fulfilled.

Now a recursive check is made to ensure all promises are called in the current chain.