PHP Class Resources\Rest

Datei anzeigen Open project: panada/panada

Public Properties

Property Type Description
$curlSSLVerifypeer
$requestData
$requestHeaders
$requestMethod
$responseOutputHeader
$responseStatus
$setRequestHeaders
$timeout

Public Methods

Method Description
__construct ( )
getClientHeaders ( ) : array Get client request headers.
getFiles ( ) : array Get clent file(s) submited by POST or PUT.
getRequest ( ) : array Get clent HTTP Request type.
getRequestData ( ) : array Getter for requestData.
getRequestMethod ( ) : string Getter for requstMethod.
getResponseStatus ( ) : integer Getter for responseStatus.
sendRequest ( string $uri, string $method = 'GET', array | string $data = null ) : booeal Send HTTP Request to server.
setRequestAuthorization ( string $signature, string $type = 'Basic' ) Set HTTP Headers Authorization.
setRequestHeaders ( array $options = [] ) Set additional HTTP Request headers.
setResponseHeader ( $code = 200 ) Set HTTP Response headers code.
wrapResponseOutput ( array $data, string $format = 'json', string $ContentType = 'application' ) : string The return data type.

Private Methods

Method Description
getPHPInput ( ) : array See this trick at http://www.php.net/manual/en/function.curl-setopt.php#96056.

Method Details

__construct() public method

public __construct ( )

getClientHeaders() public method

Get client request headers.
public getClientHeaders ( ) : array
return array

getFiles() public method

Get clent file(s) submited by POST or PUT.
public getFiles ( ) : array
return array

getRequest() public method

Get clent HTTP Request type.
public getRequest ( ) : array
return array

getRequestData() public method

Getter for requestData.
public getRequestData ( ) : array
return array

getRequestMethod() public method

Getter for requstMethod.
public getRequestMethod ( ) : string
return string

getResponseStatus() public method

Getter for responseStatus.
public getResponseStatus ( ) : integer
return integer

sendRequest() public method

Send HTTP Request to server.
public sendRequest ( string $uri, string $method = 'GET', array | string $data = null ) : booeal
$uri string The server's URL
$method string HTTP Request method type
$data array | string
return booeal if false and string if true

setRequestAuthorization() public method

Set HTTP Headers Authorization.
public setRequestAuthorization ( string $signature, string $type = 'Basic' )
$signature string Secret string to access the server
$type string The Auth type eg: Basic, OAuth etc

setRequestHeaders() public method

Set additional HTTP Request headers.
public setRequestHeaders ( array $options = [] )
$options array

setResponseHeader() public method

Set HTTP Response headers code.
public setResponseHeader ( $code = 200 )

wrapResponseOutput() public method

The return data type.
public wrapResponseOutput ( array $data, string $format = 'json', string $ContentType = 'application' ) : string
$data array
$format string
$ContentType string
return string

Property Details

$curlSSLVerifypeer public_oe property

public $curlSSLVerifypeer

$requestData public_oe property

public $requestData

$requestHeaders public_oe property

public $requestHeaders

$requestMethod public_oe property

public $requestMethod

$responseOutputHeader public_oe property

public $responseOutputHeader

$responseStatus public_oe property

public $responseStatus

$setRequestHeaders public_oe property

public $setRequestHeaders

$timeout public_oe property

public $timeout