PHP Class Bitpay\Client\Request

Inheritance: implements Bitpay\Client\RequestInterface
Show file Open project: bitpay/php-client Class Usage Examples

Protected Properties

Property Type Description
$body string
$headers array
$host string This should be something such as test.bitpay.com or just bitpay.com
$method string See the RequestInterface for all the valid methods
$path string The path is added to the end of the host
$port integer Default is 443 but should be changed by whatever is passed in through the Adapter.
$uri string $schema://$hostname/$path

Public Methods

Method Description
__construct ( )
__toString ( ) : string Converts this request into a standard HTTP/1.1 message to be sent over the wire
getBody ( )
getHeaderFields ( )
getHeaders ( )
getHeadersAsString ( ) : string
getHost ( )
getMethod ( )
getPath ( )
getPort ( )
getSchema ( )
getUri ( )
getUriWithPort ( )
isMethod ( $method )
setBody ( string $body ) The the body of the request
setHeader ( string $header, string $value ) Set a http header for the request
setHost ( string $host ) Sets the host for the request
setMethod ( string $method ) Set the method of the request, for known methods see the RequestInterface
setPath ( $path )
setPort ( $port ) This is called in the Adapter

Method Details

__construct() public method

public __construct ( )

__toString() public method

Converts this request into a standard HTTP/1.1 message to be sent over the wire
public __toString ( ) : string
return string

getBody() public method

public getBody ( )

getHeaderFields() public method

public getHeaderFields ( )

getHeaders() public method

public getHeaders ( )

getHeadersAsString() public method

public getHeadersAsString ( ) : string
return string

getHost() public method

public getHost ( )

getMethod() public method

public getMethod ( )

getPath() public method

public getPath ( )

getPort() public method

public getPort ( )

getSchema() public method

public getSchema ( )

getUri() public method

public getUri ( )

getUriWithPort() public method

public getUriWithPort ( )

isMethod() public method

public isMethod ( $method )

setBody() public method

The the body of the request
public setBody ( string $body )
$body string

setHeader() public method

Set a http header for the request
public setHeader ( string $header, string $value )
$header string
$value string

setHost() public method

Sets the host for the request
public setHost ( string $host )
$host string

setMethod() public method

Set the method of the request, for known methods see the RequestInterface
public setMethod ( string $method )
$method string

setPath() public method

public setPath ( $path )

setPort() public method

This is called in the Adapter
public setPort ( $port )

Property Details

$body protected property

protected string $body
return string

$headers protected property

protected array $headers
return array

$host protected property

This should be something such as test.bitpay.com or just bitpay.com
protected string $host
return string

$method protected property

See the RequestInterface for all the valid methods
protected string $method
return string

$path protected property

The path is added to the end of the host
protected string $path
return string

$port protected property

Default is 443 but should be changed by whatever is passed in through the Adapter.
protected int $port
return integer

$uri protected property

$schema://$hostname/$path
protected string $uri
return string