PhpGt Fetch Versions Save

Asynchronous HTTP client with promises.

v1.2.0

3 months ago

v1.1.1

10 months ago

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

What's Changed

New Contributors

Full Changelog: https://github.com/PhpGt/Fetch/compare/v1.1.0...v1.1.1

v1.1.0

1 year ago

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

What's Changed

Full Changelog: https://github.com/PhpGt/Fetch/compare/v1.0.1...v1.1.0

v1.0.1

3 years ago

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.

v1.0.0

4 years ago

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.

v0.7.0

4 years ago

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.

v0.6.3

4 years ago

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.

v0.6.2

5 years ago

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.

v0.6.1

5 years ago

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.

v0.6.0

5 years ago

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.