HTTP Requests

PHPR can perform HTTP network requests using Net_Request which is a wrapper for PHP's curl functions.

Sending a HTTP request

You can send a HTTP request using the following:

$net = Net_Request::create('http://phproad.com/');
$response = $net->send();

Sending data with a request

$net->set_post(array('field'=>'value'));

Processing a HTTP response

The result of the request above will return a Net_Response, it can be accessed using the data property:

// Contents of http://phproad.com
$result = $response->data;