From Cloudrexx Development Wiki
Jump to: navigation, search

Cloudrexx provides the following interfaces to manage network resources:

HTTP Interface

The PEAR package \HTTP_Request2 is integrated into Cloudrexx which provides the following functionality according to the official documentation:

Supports POST requests with data and file uploads, basic and digest authentication, cookies, managing cookies across requests, proxies, gzip and deflate encodings, redirects, monitoring the request progress with Observers...

Use as follows:

$request = new \HTTP_Request2($url);
$response = $request->send();

JSON over HTTP Interface

The JSON over HTTP Interface is an extension to the HTTP Interface (HTTP_Request2) that simplifies the handling of remote JSON resources.

Fetch JSON data from URL:

$jsonData = new \Cx\Core\Json\JsonData();
$json = $jsonData->getJson($url);

DNS Interface

The integrated PEAR library Net_DNS2_Resolver provides an interface to a domain name system.

Use as follows:

$nameServer = \Cx\Core\Setting\Controller\Setting::getValue(
try {
    $resolver = new \Net_DNS2_Resolver(array(
        'nameservers' => array($nameServer),
    $response = $resolver->query($domain, 'A');
    foreach($result->answer as $record) {
} catch(\Net_DNS2_Exception $e) {