# \CHttpGet

Get a image from a remote server using HTTP GET and If-Modified-Since.

## Summary

Methods
Properties
Constants
__construct()
buildUrl()
setUrl()
setHeader()
parseHeader()
doGet()
getStatus()
getLastModified()
getContentType()
getDate()
getMaxAge()
getBody()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$request
$response
N/A

File
  CHttpGet.php
Package
  Default
Class hierarchy
  \CHttpGet

## Tags

None found

## Properties

### $request

    $request :

#### Type

#

## Tags

None found

### $response

    $response :

#### Type

#

## Tags

None found

## Methods

### __construct()

    __construct()

Constructor

#

## Tags

None found

### buildUrl()

    buildUrl(string  $baseUrl, string  $merge) : string

Build an encoded url.

#### Parameters

string | $baseUrl | This is the original url which will be merged.
string | $merge | Thse parts should be merged into the baseUrl, the format is as parse_url.

#### Returns

string —

$url as the modified url.

#

## Tags

None found

### setUrl()

    setUrl(string  $url) : $this

Set the url for the request.

#### Parameters

string | $url |

#### Returns

$this

#

## Tags

None found

### setHeader()

    setHeader(string  $field, string  $value) : $this

Set custom header field for the request.

#### Parameters

string | $field |
string | $value |

#### Returns

$this

#

## Tags

None found

### parseHeader()

    parseHeader() : $this

Set header fields for the request.

#### Returns

$this

#

## Tags

None found

### doGet()

    doGet(boolean  $debug = false) : boolean

Perform the request.

#### Parameters

boolean | $debug | set to true to dump headers.

#### Throws

\Exception

  when curl fails to retrieve url.

#### Returns

boolean

#

## Tags

None found

### getStatus()

    getStatus() : integer

Get HTTP code of response.

#### Returns

integer —

as HTTP status code or null if not available.

#

## Tags

None found

### getLastModified()

    getLastModified() : integer

Get file modification time of response.

#### Returns

integer —

as timestamp.

#

## Tags

None found

### getContentType()

    getContentType() : string

Get content type.

#### Returns

string —

as the content type or null if not existing or invalid.

#

## Tags

None found

### getDate()

    getDate(mixed  $default = false) : integer

Get file modification time of response.

#### Parameters

mixed | $default | as default value (int seconds) if date is missing in response header.

#### Returns

integer —

as timestamp or $default if Date is missing in response header.

#

## Tags

None found

### getMaxAge()

    getMaxAge(mixed  $default = false) : integer

Get max age of cachable item.

#### Parameters

mixed | $default | as default value if date is missing in response header.

#### Returns

integer —

as timestamp or false if not available.

#

## Tags

None found

### getBody()

    getBody() : string

Get body of response.

#### Returns

string —

as body.

#

## Tags

None found

### CHttpGet.php