SproutCMS

This is the code documentation for the SproutCMS project

function reqAdvanced()

Performs a request while permitting advanced cURL options to be specified.
Essentially just a wrapper around cURL that has some sane options set by default;
e.g. return transfer, no return headers, SSL configured, proxy settings.

Usage

string HttpReq::reqAdvanced ( string $url , string $method [, string|array $post_data , array $curl_options ] );

Arguments

  1. string $url
    The URL to fetch.
  2. string $method
    The HTTP request method, e.g. 'POST', 'GET', etc. Case sensitive.
  3. string|array $post_data = NULL
    Data for a POST/PUT request, other request types should leave this null.
  4. array $curl_options
    Any options for cURL; these will override any default.

Exceptions thrown

  • \Exception
    If a cURL error is encountered.

Return value

  • string
    The response data (if any)