Skip to content
This class is a litle helper to communicate via curl to a web service or other external resources.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Curl.php
README.md
license.txt

README.md

Usage

To access the curl class, you must include the file in your document where you will used it.

include('Curl.php');

The following example is an instruction, how you do calls to an external service.

$curl = new Curl('http://the-service-uri-must-be-here.yz', 0);

$curl->setMethod('post');

$requestData = json_encode(["myKey" => "myVal"]);

$curl->setParams($requestData);

To call the folowing uri http://the-service-uri-must-be-here.yz/house/create/room $curl->initCurl(['house', 'create', 'room']);

Get the response `$response = json_decode($curl->response);``

You can’t perform that action at this time.