Download the PHP package amsify42/php-curl-http without Composer
On this page you can find all versions of the php package amsify42/php-curl-http. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download amsify42/php-curl-http
More information about amsify42/php-curl-http
Files in amsify42/php-curl-http
Package php-curl-http
Short Description This is a PHP package for making curl http request and getting the response
License MIT
Informations about the package php-curl-http
PHP CURL HTTP
This is the PHP package for making http request through cURL and getting response.
Installation
Table of Contents
- Initialization
- Request
- Response
1. Initialization
For creating cURL http request, we can do like this by passing url to it.
or with helper method
2. Request
If the request method is not of type GET
, we can pass this with CurlHtpp
instance
or with Amsify42\CurlHtpp\Request
instance
With Amsify42\CurlHtpp\Request
we can also call these methods.
You can simply pass json encoded request data also if you don't want to pass header or contentType for json
For headers, you can also pass array items as key values
3. Response
After executing the cURL through CurlHttp
, we will get response of type Amsify42\CurlHttp\Response
We can call these methods with the response
For executing different methods like GET, POST, PUT and DELETE, you can also call these methods to get response with a single call.
Methods post()
, put()
and delete()
expects three more optional parameters
For json request data, instead of passing contentType parameter as json
to these methods you can also pass one of the header as Content-Type: application/json
or you can simply pass json encoded request data