Class XFHttp

Description

XFHttp is a simple wrapper API around PHP HTTP streaming extension as easier interface for LB

XFHttp is a simple wrapper API around PHP HTTP streaming extension as easier interface for LB

Located in /lb_private/class.http.php (line 26)


	
			
Variable Summary
string $body_request
array $flags
array $proxy
string $uri
Method Summary
boolean execute (none 0)
mixed get_response ([none $a = ''])
string header_to_str (array $a)
true set_body (mixed $a)
boolean set_header (string $a, string $b, [string $c = 'replace'])
boolean set_method (string $a)
boolean set_option (string $a, string $b)
boolean set_proxy (string $h, [integer $p = 8080])
boolean set_uri (string $a)
Variables
string $body_request = '' (line 58)
  • var: body payload for request to server
  • access: protected
string $body_response = '' (line 62)
  • var: body payload from response from server
  • access: protected
array $flags = array('http_version'=>'1.0','enable_gzip_response'=>false) (line 38)
  • var: some options for this class
  • access: protected
array $header_request = array() (line 50)
  • var: the http request headers sent to the remote server
  • access: protected
array $header_response = array() (line 54)
  • var: the http response headers received from the remote server
  • access: protected
array $proxy = array('host'=>'','port'=>8080) (line 42)
  • var: set a proxy for the connection
  • access: protected
string $request_method = 'GET' (line 34)
  • var: what http method should be used?
  • access: protected
string $response_code = null (line 46)
  • var: the response code of a request i.e. "200 OK"
  • access: protected
string $uri = '' (line 30)
  • var: the full uri to the external resource
  • access: protected
Methods
execute (line 212)

well, parse the data and issue the request

well, parse the data and issue the request

  • since: 1.1.3
  • access: protected
boolean execute (none 0)
  • none 0
get_response (line 200)

get the response from the remote server after our request

get the response from the remote server after our request returns "code", "header" and "body"

  • since: 1.1.3
  • access: public
mixed get_response ([none $a = ''])
  • none $a
header_to_str (line 267)

transform array to a compatible string for requests

transform array to a compatible string for requests

  • since: 1.1.3
  • access: protected
string header_to_str (array $a)
  • array $a: header data
set_body (line 185)

set the body for our request usually on POST/PUT

set the body for our request usually on POST/PUT provide an array or a prepared urlencoded string

  • since: 1.1.3
  • access: public
true set_body (mixed $a)
  • mixed $a: body payload
set_header (line 159)

push a custom http header on the stack for our request

push a custom http header on the stack for our request "Date" and "Connection" are added automatically and required "Content-*" in case of POST/PUT

  • since: 1.1.3
  • access: public
boolean set_header (string $a, string $b, [string $c = 'replace'])
  • string $a: name of the header
  • string $b: value of the header
  • string $c: 'replace' is default, 'keep' preserves previous if already defined and 'append' or 'preprend' modifies it
set_method (line 98)

set the http method used for this request

set the http method used for this request

  • since: 1.1.3
  • access: public
boolean set_method (string $a)
  • string $a: method type (HEAD,GET,POST,PUT)
set_option (line 74)

set an option

set an option

  • since: 1.1.3
  • access: public
boolean set_option (string $a, string $b)
  • string $a: name of option (see XFHttp::$flags for details)
  • string $b: value of option
set_proxy (line 115)

set a http method that relays our request

set a http method that relays our request

  • since: 1.1.3
  • access: public
boolean set_proxy (string $h, [integer $p = 8080])
  • string $h: hostname or ip-address
  • integer $p: optional port number (can also be in $h like host.domain.xx:8080)
set_uri (line 137)

set the full uri for our request i.

set the full uri for our request i.e. "http://sub.domain.com/foo.html" any get paramaters can be appended as usual i.e. "?foo=bar&lbis=fine"

  • since: 1.1.3
  • access: public
boolean set_uri (string $a)
  • string $a: "well-formed" uri

Documentation generated on Sun, 20 Jun 2010 11:59:12 +0200 by phpDocumentor 1.4.3