class vB_Utility_Url

Traits

Constants

URL

TIMEOUT

POST

HEADER

POSTFIELDS

ENCODING

USERAGENT

HTTPHEADER

CLOSECONNECTION

FOLLOWLOCATION

MAXREDIRS

NOBODY

CUSTOMREQUEST

MAXSIZE

DIEONMAXSIZE

VALIDSSLONLY

ERROR_MAXSIZE

STATE_HEADERS

STATE_LOCATION

STATE_BODY

Methods

__sleep()

No description

__wakeup()

No description

__construct(vB_Utility_String $string, array|int $allowedports, string $tempfilename)

Constructor

__destruct()

No description

int
getError()

Return Error

integer
curl_callback_header(resource $ch, string $string)

Callback for handling headers

setOption(integer $option, mixed $extra)

On/Off options

integer
curl_callback_response(resource $ch, string $response)

Callback for handling the request body

false
get(string $url)

Perform a GET request

false
post(string $url, array|string $postdata)

Perform a POST request

false
postJson(string $url, string $postdata)

Perform a POST request using a JSON post body

reset()

No description

Details

__sleep()

__wakeup()

at line 122
__construct(vB_Utility_String $string, array|int $allowedports, string $tempfilename)

Constructor

Parameters

vB_Utility_String $string -- the properly configured string object.
array|int $allowedports -- ports in addition to 80 and 443 that we allow outgoing connections to.
string $tempfilename -- the tempfile that we will create and use internally for large connections we don't want to directly access the config to create this filename internally.

at line 139
__destruct()

at line 159
int getError()

Return Error

Return Value

int errorcode

at line 172
integer curl_callback_header(resource $ch, string $string)

Callback for handling headers

Parameters

resource $ch cURL object
string $string Request

Return Value

integer length of the request

at line 189
setOption(integer $option, mixed $extra)

On/Off options

Parameters

integer $option one of the option constants
mixed $extra option to set

at line 260
integer curl_callback_response(resource $ch, string $response)

Callback for handling the request body

Parameters

resource $ch cURL object
string $response Request

Return Value

integer length of the request

at line 334
false get(string $url)

Perform a GET request

Parameters

string $url

Return Value

false | array -- array headers -- the httpheaders return. Empty if the HEADER is not set -- string body -- the body of the request. Empty if NOBODY is set Returns false on error

at line 357
false post(string $url, array|string $postdata)

Perform a POST request

Parameters

string $url
array|string $postdata -- the data as either an array or "query param" string

Return Value

false | array -- array headers -- the httpheaders return. Empty if the HEADER is not set -- string body -- the body of the request. Empty if NOBODY is set Returns false on error

at line 385
false postJson(string $url, string $postdata)

Perform a POST request using a JSON post body

This performs as post using a custom JSON request (popular with REST APIs) instead of a standard x-www-form-urlencoded format

Parameters

string $url
string $postdata -- the JSON encoded request.

Return Value

false | array -- array headers -- the httpheaders return. Empty if the HEADER is not set -- string body -- the body of the request. Empty if NOBODY is set Returns false on error

at line 611
reset()