You are here

function cc::load_url in Constant Contact 6.3

Same name and namespace in other branches
  1. 6.2 class.cc.php \cc::load_url()
  2. 7.3 class.cc.php \cc::load_url()

* Loads a specific URL, this method is used by the user friendly methods *

25 calls to cc::load_url()
cc::clear_contacts in ./class.cc.php
* Be careful with this method :) * You can use this to clear all contacts from a specific set of contact lists * * *
cc::create_campaign in ./class.cc.php
* Creates a new campaign * * @access public
cc::create_contact in ./class.cc.php
* Creates a new contact * * @access public
cc::create_contacts in ./class.cc.php
* This method is used to add 25 or more contacts * Pass this method an associative array of contact details * Alternatively you can give the path to a local or remote file * The file should be text or CSV format: * @link…
cc::create_list in ./class.cc.php
* Creates a new contact list * * * @access public

... See full list

File

./class.cc.php, line 1819

Class

cc
@file

Code

function load_url($action = '', $method = 'get', $params = array(), $expected_http_code = 200) {
  $this
    ->http_send($this->api_url . $action, $method, $params);

  // handle status codes
  if (intval($expected_http_code) === $this->http_response_code) {
    if ($this->http_content_type) {
      return $this
        ->xml_to_array($this->http_response_body);
    }
    else {
      return $this->http_response_body;

      /* downloads the file */
    }
  }
  else {
    $this->last_error = "Invalid status code {$this->http_response_code}";

    // if their was an error sometimes the body contains useful info
    return false;
  }
}