PHP Interface Bitpay\Client\RequestInterface

Show file Open project: bitpay/php-client Interface Usage Examples

Public Methods

Method Description
getBody ( ) : string Returns the request body
getHeaders ( ) : array Returns a $key => $value array of http headers
getHost ( ) : string Returns the host to send the request to. The host would be something such as test.bitpay.com or bitpay.com
getMethod ( ) : string Returns the method for this request
getPath ( ) : string example of path is api/invoice as this is appended to $host
getPort ( ) : integer Returns port to send request on
getSchema ( ) : string Should always return https
getUri ( ) : string Returns $schema://$host:$port/$path
isMethod ( string $method ) : boolean Checks the request to see if the method matches a known value

Method Details

getBody() public method

Returns the request body
public getBody ( ) : string
return string

getHeaders() public method

Returns a $key => $value array of http headers
public getHeaders ( ) : array
return array

getHost() public method

Returns the host to send the request to. The host would be something such as test.bitpay.com or bitpay.com
public getHost ( ) : string
return string

getMethod() public method

Returns the method for this request
public getMethod ( ) : string
return string

getPath() public method

example of path is api/invoice as this is appended to $host
public getPath ( ) : string
return string

getPort() public method

Returns port to send request on
public getPort ( ) : integer
return integer

getSchema() public method

Should always return https
public getSchema ( ) : string
return string

getUri() public method

Returns $schema://$host:$port/$path
public getUri ( ) : string
return string

isMethod() public method

Checks the request to see if the method matches a known value
public isMethod ( string $method ) : boolean
$method string
return boolean