Skip to content
Greg Bowler edited this page Mar 27, 2023 · 6 revisions

The Fetch API provides an interface for fetching resources, typically across the network. It's a web standard, defined at https://fetch.spec.whatwg.org/#fetch-method.

It will seem familiar to anyone who has used XMLHttpRequest, but the new API provides a more powerful and flexible feature set.

This project brings the fetch API to the server in PHP, so you can use the same syntax that you are used to in JavaScript to perform blocking or non-blocking HTTP requests within your PHP applications.

Why do we need another HTTP library?

Although PHP is a general purpose programming language, it has such deep ties with the web platform. PHP.Gt's mission is to bring well known web technologies to server side web development.

There are plenty of other more widely adopted PHP HTTP clients, but outside of PHP they are not known by web developers at all. Fetch is an API that's standardised for making HTTP requests and handling their responses as streams. This is the PHP implementation.

Clone this wiki locally