Download the PHP package coderatio/curler without Composer
On this page you can find all versions of the php package coderatio/curler. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download coderatio/curler
More information about coderatio/curler
Files in coderatio/curler
Package curler
Short Description A clean PHP HTTP client that makes it easy to send HTTP requests and trivial to integrate with web services
License MIT
Informations about the package curler
Curler
An elegant PHP HTTP client for sending HTTP requests.
Requirements
php 7.1+
OpenSSL
cURL
Installation
This library can easily be installed using composer. Run the command below:
GET
Because this is built with simplicity in mind from the beginning, below is how easy you can make a get request to another server.
POST
POST FORM
Sending form data via curler is as simple sending a post
request. Just send an array of your form data and curler will take care of the rest. Take a look below:
By default, the $response
variable will hold a json object of the request. But, there are instances where you want the response in php object or array. You can get them as below:
OR
Other Request Methods
- PUT
- DELETE
- DOWNLOAD
- OPTIONS
- HEAD
- TRACE
Just as you use the post, get, postForm e.t.c, you can also use the put
, delete
, download
, options
, head
, and trace
methods.
Adding Custom Headers
Sometimes, you may need to send your request with custom headers. Curler, has full support for that and many more. Here is how it can be done.
-
Single Header
-
Multiple headers
Get Status Code
Sometimes, you may like to get the status code returned from a request. This can easily be done with curler as below:
Add cURL options
Since this package is built with flexibility in mind, adding cURL options should be a breeze. Here is how you can add options:
Contributors
To be a contributor, kindly fork the repo, add or fix bugs and send a pull request.
Contribution
To contribute to this project, kindly fork it and send a pull request or find me on Twitter.
License
This project is licenced with the MIT license.