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 yet 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. Nearly every PHP developer will be familiar with these two APIs. So why do we need another?

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

Clone this wiki locally