Download the PHP package adaiasmagdiel/cururu without Composer
On this page you can find all versions of the php package adaiasmagdiel/cururu. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download adaiasmagdiel/cururu
More information about adaiasmagdiel/cururu
Files in adaiasmagdiel/cururu
Package cururu
Short Description A lightweight PHP library that simplifies making HTTP requests with cURL, offering a minimalistic approach for handling web APIs with an easy-to-use interface and essential features, ideal for smaller projects.
License MIT
Informations about the package cururu
Cururu
Cururu is a lightweight PHP library designed to simplify making HTTP requests with cURL. It offers a minimalistic approach to handling web APIs, providing an easy-to-use interface with essential features. This makes it ideal for smaller projects that need efficient HTTP request handling without the overhead of larger libraries.
Features
- Simple and intuitive interface for making HTTP requests.
- Optional base URL configuration, or you can use full URLs directly in requests.
- Configurable headers and timeouts.
- SSL verification toggle for secure or insecure requests.
- cURL error handling and automatic response parsing.
- Support for JSON, form-data, and URL-encoded bodies in POST requests.
- Lightweight and easy to integrate into any PHP project.
Installation
To include Cururu in your project, use Composer. First, ensure you have Composer installed, then run the following command:
Usage
Basic Example
Using Full URLs without Base URL
Cururu allows you to skip the base URL entirely and use full URLs directly in the request methods.
Setting Custom Headers
You can set additional headers for each request or globally for the instance.
Handling POST Requests
Cururu supports different content types for POST requests, such as application/json
and application/x-www-form-urlencoded
.
Error Handling
Cururu provides error handling for cURL operations. In case of a request failure, an exception will be thrown with a descriptive error message.
Response Handling
Cururu provides a Response
object that encapsulates the HTTP response, offering methods to work with the response content, status code, and headers.
License
Cururu is licensed under the MIT License.
Contributing
Contributions are welcome! Please fork this repository and submit a pull request with your changes.