Open-source OpenAPI/Swagger toolkit with an interactive API reference, an offline-first API client, and integrations for many web frameworks.
php-curl-class/php-curl-class
A PHP library that wraps cURL in a simple object-oriented API for sending HTTP requests and calling web APIs.
- Stars
- 3,299
- Forks
- 801
- Open issues
- 0
- Last commit
- 6 days ago
What is it?
PHP Curl Class wraps PHP's cURL extension in an object-oriented interface. Instead of configuring raw curl handles, you create a Curl object and call methods such as get, post, put, patch and delete, with query or body data passed as arrays. Responses are decoded automatically based on content type, and the object exposes the response, response headers, request headers, and error details as properties.
The library also covers common HTTP needs: basic and digest authentication, cookies, proxies, redirects, custom headers, file uploads, and downloads, including case-insensitive header access. A MultiCurl class runs many requests in parallel and lets you attach success, error and complete callbacks to each one.
It supports PHP 8.0 through 8.5 and installs with Composer.
Key features
- 01Object-oriented methods for GET, POST, PUT, PATCH, DELETE and other HTTP verbs
- 02Automatic response decoding for JSON and XML
- 03Basic and digest authentication, cookies and proxy support
- 04Parallel requests with success, error and complete callbacks via MultiCurl
- 05File download and upload helpers
- 06Case-insensitive access to response headers
Use cases
- Calling third-party REST or JSON APIs from a PHP backend
- Scraping web pages or submitting forms from PHP scripts
- Sending many HTTP requests concurrently, such as querying several search endpoints
- Downloading files with cURL options managed through a simple interface
Quick start
- 1
Install the library with Composer
composer require php-curl-class/php-curl-class - 2
Load Composer's autoloader and create a Curl object to send a GET request
In collections
Topics
FAQ
- What is php-curl-class?
- A PHP library that wraps cURL in a simple object-oriented API for sending HTTP requests and calling web APIs. PHP Curl Class wraps PHP's cURL extension in an object-oriented interface. Instead of configuring raw curl handles, you create a Curl object and call methods such as get, post, put, patch and delete, with query or body data passed as arrays. Responses are decoded automatically based on content type, and the object exposes the response, response headers, request headers, and error details as properties.
- Is php-curl-class free to use? What license does it have?
- php-curl-class is open source under the Unlicense license. Check the license terms before using it in commercial products.
- Is php-curl-class still maintained?
- Actively maintained. The last commit to php-curl-class was on Nov 2, 2026.
- What can I use php-curl-class for?
- Calling third-party REST or JSON APIs from a PHP backend Scraping web pages or submitting forms from PHP scripts Sending many HTTP requests concurrently, such as querying several search endpoints Downloading files with cURL options managed through a simple interface
- How do I install php-curl-class?
- Install the library with Composer: composer require php-curl-class/php-curl-class Load Composer's autoloader and create a Curl object to send a GET request
- Where can I get php-curl-class?
- The source code and installation instructions are on GitHub: https://github.com/php-curl-class/php-curl-class
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
An extensible PHP HTTP client for sending synchronous and asynchronous requests and integrating with web services.
Python HTTP client built on curl that can impersonate browser TLS, JA3, and HTTP/2 fingerprints to get past blocks.
A Java library that runs raw curl commands as ordinary Java method calls, so you can paste curl from Postman or browser DevTools without writing HTTP client code.
A simple, elegant Python HTTP library for sending HTTP/1.1 requests with sessions, cookies, auth, and JSON support.
Open-source API client that stores collections as plain-text files on your filesystem, an offline alternative to Postman and Insomnia.