Download the PHP package iamirnet/curl without Composer
On this page you can find all versions of the php package iamirnet/curl. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download iamirnet/curl
More information about iamirnet/curl
Files in iamirnet/curl
Package curl
Short Description Curl class for PHP
License MIT
Homepage https://php.iamir.net/packages/curl
Informations about the package curl
iCurl
iCurl is a lightweight PHP library for making HTTP requests using cURL. It supports various HTTP methods, handles JSON and URL-encoded data, and simplifies common cURL operations.
Features
- Easy-to-use interface for HTTP methods:
GET
,POST
,PUT
,DELETE
, and more. - Automatic handling of query parameters and data formatting.
- Built-in support for file downloads.
- JSON encoding/decoding and validation utilities.
- Flexible configuration with additional cURL options.
Installation
Click for help with installation
## Install Composer If the above step didn't work, install composer and try again. #### Debian / Ubuntu Composer not found? Use this command instead: #### Installing on Windows Download and install composer: 1. https://getcomposer.org/download/ 2. Create a folder on your drive like C:\iAmirNet\XT 3. Run command prompt and type `cd C:\iAmirNet\XT` 4. 5. Once complete copy the vendor folder into your project.Getting started
composer require iamirnet/curl
Usage
Creating an iCurlService Instance
Sending a GET Request
Sending a POST Request
Sending a PUT Request
Sending a DELETE Request
Usage Static
Sending a GET Request
Sending a POST Request
Sending a PUT Request
Sending a DELETE Request
Advanced Features
Downloading Files
Checking Resource Existence
Handling JSON
Decoding JSON Responses
Validating JSON Strings
iCurl Functions
This package provides helper functions for interacting with the iCurl class. These functions make it easy to send HTTP requests (GET, POST, PUT, DELETE) and check if a URL exists.
Functions Overview
i_curl
This function sends an HTTP request to the specified endpoint using the specified method.
Parameters:
string $base
: The base URL for the request.string $url
: The specific URL endpoint for the request.array $params
: Optional query parameters to send with the request.$data
: Optional data to send in the request body.array $headers
: Optional headers to include in the request.string $method
: The HTTP method (default is 'GET').array $options
: Additional curl options.
Returns:
- The response from the
iCurl::request
function.
i_curl_get
This function sends a GET request to the specified endpoint.
Parameters:
string $base
: The base URL for the request.string $url
: The specific URL endpoint for the GET request.array $params
: Optional query parameters to send with the GET request.array $headers
: Optional headers to include in the request.array $options
: Additional curl options.
Returns:
- The response from the
iCurl::request
function.
i_curl_post
This function sends a POST request to the specified endpoint.
Parameters:
string $base
: The base URL for the request.string $url
: The specific URL endpoint for the POST request.$data
: Data to send in the POST request body.array $params
: Optional query parameters to send with the POST request.array $headers
: Optional headers to include in the request.array $options
: Additional curl options.
Returns:
- The response from the
iCurl::request
function.
i_curl_delete
This function sends a DELETE request to the specified endpoint.
Parameters:
string $base
: The base URL for the request.string $url
: The specific URL endpoint for the DELETE request.$data
: Optional data to send in the DELETE request body.array $params
: Optional query parameters to send with the DELETE request.array $headers
: Optional headers to include in the request.array $options
: Additional curl options.
Returns:
- The response from the
iCurl::request
function.
i_curl_put
This function sends a PUT request to the specified endpoint.
Parameters:
string $base
: The base URL for the request.string $url
: The specific URL endpoint for the PUT request.$data
: Data to send in the PUT request body.array $params
: Optional query parameters to send with the PUT request.array $headers
: Optional headers to include in the request.array $options
: Additional curl options.
Returns:
- The response from the
iCurl::request
function.
i_curl_dl
This function downloads a file from the specified URL.
Parameters:
string $base
: The base URL for the request.string $url
: The specific URL endpoint to download the file from.string $out
: The local path to save the downloaded file.array $params
: Optional query parameters to send with the request.$data
: Optional data to send with the request.array $headers
: Optional headers to include in the request.string $method
: The HTTP method for the request (default is 'GET').array $options
: Additional curl options.
Returns:
- The response from the
iCurl::download
function.
i_curl_exists
This function checks if a URL exists by sending a HEAD request.
Parameters:
string $base
: The base URL for the request.string $url
: The specific URL to check for existence.
Returns:
true
if the URL exists,false
if it does not.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contribution
- Give us a star :star:
- Fork and Clone! Awesome
- Select existing issues or create a new issue and give us a PR with your bugfix or improvement after. We love it ❤️
Donate
- USDT Or TRX: TW5yoa21PJQe1dy1ErnCxh3kfpwDaivHQZ 😘❤