HPCloud-PHP
1.2.0
PHP bindings for HPCloud and OpenStack services.
|
Describes a Transporter. More...
Public Member Functions | |
doRequest ($uri, $method= 'GET', $headers=array(), $body= '') | |
Perform a request. | |
doRequestWithResource ($uri, $method, $headers, $resource) | |
Perform a request, but use a resource to read the body. |
Public Attributes | |
const | HTTP_USER_AGENT = 'HPCloud-PHP/1.0' |
Describes a Transporter.
Transporters are responsible for moving data from the remote cloud to the local host. Transporters are responsible only for the transport protocol, not for the payloads.
The current OpenStack services implementation is oriented toward REST-based services, and consequently the transport layers are HTTP/HTTPS, and perhaps SPDY some day. The interface reflects this. it is not designed as a protocol-neutral transport layer
Definition at line 41 of file Transporter.php.
doRequest | ( | $uri, | |
$method = 'GET' , |
|||
$headers = array() , |
|||
$body = '' |
|||
) |
Perform a request.
Invoking this method causes a single request to be relayed over the transporter. The transporter MUST be capable of handling multiple invocations of a doRequest() call.
string | $uri | The target URI. |
string | $method | The method to be sent. |
array | $headers | An array of name/value header pairs. |
string | $body | The string containing the request body. |
Implemented in CURLTransport, and PHPStreamTransport.
doRequestWithResource | ( | $uri, | |
$method, | |||
$headers, | |||
$resource | |||
) |
Perform a request, but use a resource to read the body.
This is a special version of the doRequest() function. It handles a very spefic case where...
Examples of appropriate cases for this variant:
Note that all parameters are required.
string | $uri | The target URI. |
string | $method | The method to be sent. |
array | $headers | An array of name/value header pairs. |
mixed | $resource | The string with a file path or a stream URL; or a file object resource. If it is a string, then it will be opened with the default context. So if you need a special context, you should open the file elsewhere and pass the resource in here. |
Implemented in PHPStreamTransport, and CURLTransport.
const HTTP_USER_AGENT = 'HPCloud-PHP/1.0' |
Definition at line 43 of file Transporter.php.