Class MOXMAN_Http_HttpClient
Inheritance | MOXMAN_Http_HttpClient |
---|
This class wrapps in the HTTP Request and adds various useful options.
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Constructs a new HttpClient instance. | MOXMAN_Http_HttpClient |
close() | Closes the internal socket for the HTTP client. | MOXMAN_Http_HttpClient |
createFormData() | Creates a new http form data instance. | MOXMAN_Http_HttpClient |
createRequest() | Creates a new HTTP request instance for the specified path. | MOXMAN_Http_HttpClient |
getBufferSize() | Returns the buffer size in bytes. | MOXMAN_Http_HttpClient |
getInputStream() | Returns the input stream that the HTTP client reads data from. | MOXMAN_Http_HttpClient |
getLogLevel() | Returns the current log level. 0 = no logging, 1 = basic logging, 2 = verbose logging. | MOXMAN_Http_HttpClient |
getOutputStream() | Returns the output stream that the HTTP client writes data to. | MOXMAN_Http_HttpClient |
getReadTimeout() | Returns the read data timeout. | MOXMAN_Http_HttpClient |
getSocketStream() | Returns the clients internal socket resource. | MOXMAN_Http_HttpClient |
log() | Logs the specified string to log function if the level is grater than 0. | MOXMAN_Http_HttpClient |
setInputStream() | Sets the input stream resource handle. | MOXMAN_Http_HttpClient |
setLogFunction() | Sets the log function to be called. | MOXMAN_Http_HttpClient |
setLogLevel() | Sets the current log level. 0 = no logging, 1 = basic logging, 2 = verbose logging. | MOXMAN_Http_HttpClient |
setOutputStream() | Sets the output stream resource handle. | MOXMAN_Http_HttpClient |
setReadTimeout() | Sets the read data timeout. | MOXMAN_Http_HttpClient |
Method Details
Constructs a new HttpClient instance.
public void __construct ( $host, $port = 80 ) | ||
$host | string | HTTP host name to connect to or URL string to grab host and port from. |
$port | int | Port number |
Closes the internal socket for the HTTP client.
public void close ( ) |
Creates a new http form data instance.
public MOXMAN_Http_HttpClientFormData createFormData ( ) | ||
return | MOXMAN_Http_HttpClientFormData | Http form data instance to be send to client. |
---|
Creates a new HTTP request instance for the specified path.
public MOXMAN_Http_HttpClientRequest createRequest ( $path, $method = "get" ) | ||
$path | string | Path to create request instance for. |
$method | string | Method to send. |
return | MOXMAN_Http_HttpClientRequest | HTTP request instance to create. |
---|
Returns the buffer size in bytes.
public Int getBufferSize ( ) | ||
return | Int | Number of bytes to buffer. |
---|
Returns the input stream that the HTTP client reads data from.
public resource getInputStream ( ) | ||
return | resource | Resource handle to input stream. |
---|
Returns the current log level. 0 = no logging, 1 = basic logging, 2 = verbose logging.
public int getLogLevel ( ) | ||
return | int | Current log level. |
---|
Returns the output stream that the HTTP client writes data to.
public Resource getOutputStream ( ) | ||
return | Resource | Resource handle to output stream. |
---|
Returns the read data timeout.
public int getReadTimeout ( ) | ||
return | int | Read timeout. |
---|
Returns the clients internal socket resource.
public resource getSocketStream ( ) | ||
return | resource | Resource for internal socket. |
---|
Logs the specified string to log function if the level is grater than 0.
public void log ( $str ) | ||
$str | string | This is a description |
Sets the input stream resource handle.
public void setInputStream ( $handle ) | ||
$handle | Resource | Resource handle to read data from. |
Sets the log function to be called.
public void setLogFunction ( $func ) | ||
$func | mixed | Name of function or array with instance and method name. |
Sets the current log level. 0 = no logging, 1 = basic logging, 2 = verbose logging.
public void setLogLevel ( $level ) | ||
$level | Int Current log level. |
Sets the output stream resource handle.
public void setOutputStream ( $handle ) | ||
$handle | resource | Resource handle to write data to. |
Sets the read data timeout.
public void setReadTimeout ( $timeout ) | ||
$timeout | Int Read timeout. |