HTTP content fetching library

package org.openpsa.httplib

 Methods

get (string $url, array $headers, string $username, string $password)

Get contents of given URL

Parameters

$url

stringFully qualified URL

$headers

arrayAdditional HTTP headers

$username

stringUsername, if any

$password

stringPassword, if any

Returns

stringContents

post (string $uri, array $variables, array $headers)

Post variables and get the resulting page

Parameters

$uri

stringFully qualified URL

$variables

array&$variables The data to POST (key => value pairs)

$headers

arrayAdditional HTTP headers

Returns

stringContents

set_param (string $name, mixed $value)

Set one of the HTTP_Request2 parameters

Parameters

$name

stringThe parameter's name

$value

mixedThe new value

_http_code2error ($code)

Parameters

$code

_is_success (int $response_code)

Check whether a HTTP response code is a "successful" one

Parameters

$response_code

intHTTP response code to check

Returns

booleanWhether HTTP response code is successful

_user_agent ()

 Properties

 

mixed $basicauth

 

mixed $error

 

mixed $files

 

mixed $_client

 

mixed $_params