XpressEngine Core  1.11.2
 All Classes Namespaces Files Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
XEHttpRequest Class Reference

Public Member Functions

 __construct ($host, $port, $scheme='')
 
 addToHeader ($key, $value)
 
 send ($target= '/', $method= 'GET', $timeout=3, $post_vars=NULL)
 
 sendWithSock ($target, $method, $timeout, $post_vars)
 
 sendWithCurl ($target, $method, $timeout, $post_vars)
 

Public Attributes

 $m_host
 
 $m_port
 
 $m_scheme
 
 $m_headers
 

Detailed Description

Definition at line 13 of file XEHttpRequest.class.php.

Constructor & Destructor Documentation

XEHttpRequest::__construct (   $host,
  $port,
  $scheme = '' 
)

constructor

Returns
void

Definition at line 44 of file XEHttpRequest.class.php.

Member Function Documentation

XEHttpRequest::addToHeader (   $key,
  $value 
)

Mether to add key/value pair to the HTTP request header

Parameters
int | string$keyHTTP header element
string$valuevalue string for HTTP header element
Returns
void

Definition at line 58 of file XEHttpRequest.class.php.

XEHttpRequest::send (   $target = '/',
  $method = 'GET',
  $timeout = 3,
  $post_vars = NULL 
)

Send HTTP message to the host

Parameters
string$targetip or url of the external server
string$methodHTTP method such as GET and POST
int$timeouttime out value for HTTP request expiration
array$post_varsvariables to send
Returns
object Returns an object containing HTTP Response body and HTTP response code

Definition at line 71 of file XEHttpRequest.class.php.

XEHttpRequest::sendWithCurl (   $target,
  $method,
  $timeout,
  $post_vars 
)

Send a request with the curl library

Parameters
string$targetip or url of the external server
string$methodHTTP method such as GET and POST
int$timeouttime out value for HTTP request expiration
array$post_varsvariables to send
Returns
object Returns an object containing HTTP Response body and HTTP response code

Definition at line 205 of file XEHttpRequest.class.php.

XEHttpRequest::sendWithSock (   $target,
  $method,
  $timeout,
  $post_vars 
)

Send a request with the file socket

Parameters
string$targetip or url of the external server
string$methodHTTP method such as GET and POST
int$timeouttime out value for HTTP request expiration
array$post_varsvariables to send
Returns
object Returns an object containing HTTP Response body and HTTP response code

Definition at line 115 of file XEHttpRequest.class.php.

Member Data Documentation

XEHttpRequest::$m_headers

Definition at line 38 of file XEHttpRequest.class.php.

XEHttpRequest::$m_host

Definition at line 20 of file XEHttpRequest.class.php.

XEHttpRequest::$m_port

Definition at line 26 of file XEHttpRequest.class.php.

XEHttpRequest::$m_scheme

Definition at line 32 of file XEHttpRequest.class.php.


The documentation for this class was generated from the following file: