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.

The Fetch API is standardised in all modern web browsers in JavaScript and is well known to web developers around the world.

This project brings the fetch API to the server in PHP, so you can use the same syntax and promise-based workflow 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?

There are already so many HTTP libraries in the PHP ecosystem. If you want to use the most popular, use Guzzle. If you want the simplest (and built-in to PHP), use Curl.

PHP.Gt's mission is to bring well-known web standards to server side PHP development.

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][http1] [are][http2] [plenty][http3] [of][http4] [other][http5] [more][http6] [widely][http7] [adopted][http8] 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