Interface

# VMware_VCloud_SDK_Http_Client_Interface

interface VMware_VCloud_SDK_Http_Client_Interface

## Methods

| setAuth(array $auth) Set the login user name and password. |
| setConfig(array $config) Set the HTTP configurations used by HTTP request. |
VMware_VCloud_SDK_Http_Response_Interface | get(string $url, array $headers = null) HTTP GET request |
VMware_VCloud_SDK_Http_Response_Interface | post(string $url, array $headers, mixed $data) HTTP POST request |
VMware_VCloud_SDK_Http_Response_Interface | put(string $url, array $headers, mixed $data) HTTP POST request |
VMware_VCloud_SDK_Http_Response_Interface|null | delete(string $url) HTTP DELETE request |
| download(string $url, array $headers, string $dest) Download a file and dump to specified location. |
| upload(string $url, array $headers, string $file) Upload a file. |

## Details

###
at line 11
`public setAuth(array $auth)`

Set the login user name and password.

#### Parameters

array | $auth | In array('username'=>, 'password'=>) format

###
at line 21
`public setConfig(array $config)`

Set the HTTP configurations used by HTTP request.

#### Parameters

array | $config | In array(''=>, ''=>, ... ''=>) format

###
at line 31
`public VMware_VCloud_SDK_Http_Response_Interface get(string $url, array $headers = null)`

HTTP GET request

#### Parameters

string | $url | URL to send an HTTP request
array | $headers | HTTP request headers

#### Return Value

VMware_VCloud_SDK_Http_Response_Interface |

###
at line 42
`public VMware_VCloud_SDK_Http_Response_Interface post(string $url, array $headers, mixed $data)`

HTTP POST request

#### Parameters

string | $url | URL to send an HTTP request
array | $headers | HTTP request headers
mixed | $data | HTTP request body

#### Return Value

VMware_VCloud_SDK_Http_Response_Interface |

###
at line 53
`public VMware_VCloud_SDK_Http_Response_Interface put(string $url, array $headers, mixed $data)`

HTTP POST request

#### Parameters

string | $url | URL to send an HTTP request
array | $headers | HTTP request headers
mixed | $data | HTTP request body

#### Return Value

VMware_VCloud_SDK_Http_Response_Interface |

###
at line 62
`public VMware_VCloud_SDK_Http_Response_Interface|null delete(string $url)`

HTTP DELETE request

#### Parameters

string | $url | URL to send an HTTP request

#### Return Value

VMware_VCloud_SDK_Http_Response_Interface|null |

###
at line 72
`public download(string $url, array $headers, string $dest)`

Download a file and dump to specified location.

#### Parameters

string | $url | Download source
array | $headers | HTTP request headers
string | $dest | Destination of the file to write to

###
at line 82
`public upload(string $url, array $headers, string $file)`

Upload a file.

#### Parameters

string | $url | Target to upload the file
array | $headers | HTTP request headers
string | $file | Full path of the file to be uploaded