Blesta
  • Package
  • Class
  • Tree
  • Deprecated

Packages

  • blesta
    • app
      • controllers
      • models
    • components
      • areyouahuman
      • auth
        • motp
        • oath
      • delivery
        • interfax
        • postal
          • methods
      • download
      • email
      • events
        • default
      • exchange
        • rates
          • google
            • finance
          • yahoo
            • finance
      • gateway
        • payments
      • gateways
      • invoice
        • delivery
        • templates
          • quickbooks
            • invoice
      • json
      • modules
      • net
        • amazon
          • s3
        • http
        • net
          • geo
            • ip
      • plugins
      • recaptcha
      • reports
        • aging
          • invoices
        • custom
          • report
        • invoice
          • creation
        • tax
          • liability
        • transactions
          • applied
          • received
      • security
      • session
        • cart
      • settingscollection
      • upgrades
        • tasks
      • upload
      • vcard
    • helpers
      • currency
        • format
      • data
        • structure
          • array
          • string
      • text
        • parser
      • widget
        • client
  • minPHP
    • components
      • input
      • record
    • helpers
      • color
      • data
        • structure
      • date
      • form
      • html
      • javascript
      • xml
    • lib
  • None
  • PHP

Classes

  • Http

Class Http

Http component that wraps cURL

Package: blesta\components\net\http
Copyright: Copyright (c) 2010, Phillips Data, Inc.
License: The Blesta License Agreement
Link: Blesta
Located at components/net/http/http.php

Methods summary

public
# __construct( )

Creates a new NetHttp object, initializes a curl instance

Creates a new NetHttp object, initializes a curl instance

public
# __destruct( )

Closes the current curl instance, if open

Closes the current curl instance, if open

public
# open( )

Explicitly open the curl instance, and close any open instance

Explicitly open the curl instance, and close any open instance

public
# close( )

Explicitly close the curl instance, if open

Explicitly close the curl instance, if open

public
# persistenConnection( boolean $persist )

Set whether or not this connection should be persistent

Set whether or not this connection should be persistent

Parameters

$persist
boolean
$persist True to persist, false not to.
public string
# get( string $url, mixed $params = null )

Execute a GET request on the given URL

Execute a GET request on the given URL

Parameters

$url
string
$url The URL to GET
$params
mixed
$params An array of key/value pairs, or a string of the format key=value&...

Returns

string
The response from the URL

See

NetHttp::responseCode()
public string
# post( mixed $url, array $params = null, mixed $files = null )

Execut a POST request on the given URL

Execut a POST request on the given URL

Parameters

$url
mixed
$params An array of key/value pairs, or a string of the format key=value&...
$params
array
$files A multi-dimensional array of files in the format of [0]=>array("name"=>"Name of file", "file"=>"File path")
$files

Returns

string
The response from the URL

See

NetHttp::responseCode()
public integer
# responseCode( )

Fetch the response code for that last request

Fetch the response code for that last request

Returns

integer
The HTTP response code for that last request
public
# setCookieFile( string $cookie_file )

Set the cookie file to use for this request

Set the cookie file to use for this request

Parameters

$cookie_file
string
The file name of the cookie file to set

Throws

Exception
thrown when the given $cookie_file does not exist
public
# setHeaders( array $headers )

Set an array of headers, overwritting existing header data

Set an array of headers, overwritting existing header data

Parameters

$headers
array
$headers Headers of the format array("Content Type: text/html", "...")
public
# setHeader( string $header )

Set a header value, appending it to the existing header data

Set a header value, appending it to the existing header data

Parameters

$header
string
$header Header string of the format "Content Type: text/html"
public
# setTimeout( integer $seconds )

Set the timeout for the current request

Set the timeout for the current request

Parameters

$seconds
integer
$seconds The number of seconds to wait before timing out
public
# setOption( integer $option, string $value, boolean $override = true )

Set the given $option and $value. Accepts CURLOPT_* options.

Set the given $option and $value. Accepts CURLOPT_* options.

Parameters

$option
integer
$option The CURLOPT_* option to set
$value
string
$value The value to set
$override
boolean
$override True to override the existing value, otherwise will only set the value if not already set
public string
# request( string $method, string $url, mixed $params = null )

Processes the request using the given method and URL, with optional urlencoded parameters

Processes the request using the given method and URL, with optional urlencoded parameters

Parameters

$method
string
$method The request method (e.g. GET, POST, PUT, DELETE, etc.)
$url
string
$url The URL to requets
$params
mixed
$params An array of parametes or a URL encoded string of parameters

Returns

string
The response from the URL

See

NetHttp::responseCode()
public
# debug( resource $debug_stream )

Enables debugging, which is sent to the given stream

Enables debugging, which is sent to the given stream

Parameters

$debug_stream
resource
$debug_stream The stream to output debugging info to

Magic methods summary

Blesta API documentation generated by ApiGen 2.8.0