\Hazaar\Http
Request
Summary
Methods Properties Constants
uri
No constants
Properties
$body
$body
$context
$context
$fsock_host
$fsock_host
$headers
$headers
$method
$method
$raw_uri
$raw_uri
$uri
$uri
Methods
__construct()
__construct($uri = null, $method = 'GET', $content_type = null, $custom_context = null)

Parameters

$uri

No description

$method

No description

$content_type

No description

$custom_context

No description

addMultipart()
addMultipart($data, $content_type = null)

Parameters

$data

No description

$content_type

No description

allowSelfSigned()
allowSelfSigned($value = true) : boolean
When using SSL communications, this allows the use of self-signed certificates.

Parameters

$valueboolean

Returns

boolean
authorisation()
authorisation($user, $type = null)

Parameters

$user

No description

$type

No description

authorise()
authorise($username, $password)
Add Basic HTTP authentication

Basic authentication should ONLY be used over HTTPS.

Other methods are not yet supported, however Bearer is implemented using Request::authorization() method.

Parameters

$usernamemixed

The username to send

$passwordmixed

The password to send

authorization()
authorization($user, $type = 'Bearer')

Parameters

$user

No description

$type

No description

enableMultipart()
enableMultipart()
getBody()
getBody()
getHeader()
getHeader($key)

Parameters

$key

No description

getHeaders()
getHeaders()
getHost()
getHost()
setBody()
setBody($body)

Parameters

$body

No description

setContextOption()
setContextOption($options) : boolean
Wrapper function to the internal PHP function stream_context_set_option() function.

See http://php.net/manual/en/context.ssl.php documentation for all the available wrappers and options.

Parameters

$optionsmixed

Must be an associative array in the format $arr['wrapper']['option'] = $value;

Returns

boolean

Returns TRUE on success or FALSE on failure.

setHeader()
setHeader($key, $value, $allow_multiple = false)

Parameters

$key

No description

$value

No description

$allow_multiple

No description

setLocalCertificate()
setLocalCertificate($local_cert, $passphrase = null, $local_pk = null) : boolean
Set a local PEM encoded certificate to use for SSL communication

Tags

Throws

Exception\CertificateNotFound

Parameters

$local_certmixed
$passphrasemixed
$local_pk

No description

Returns

boolean
toString()
toString($encryption_key = null, $encryption_cipher = null)

Parameters

$encryption_key

No description

$encryption_cipher

No description

uri()
uri($uri = null) : \Hazaar\Http\Uri
Summary of uri

Tags

Throws

Exception\HostNotFound

Parameters

$urimixed

Returns

\Hazaar\Http\Uri
verifyPeer()
verifyPeer($value = true) : boolean
When using SSL communications, this sets whether peer certificate verification is used.

Parameters

$valueboolean

Returns

boolean
verifyPeerName()
verifyPeerName($value = true) : boolean
When using SSL communications, this sets whether peer name verification is used.

Parameters

$valueboolean

Returns

boolean