10 defined(
'JPATH_PLATFORM') or die();
56 $this->options = isset($options) ? $options :
new JRegistry;
57 $this->client = isset($client) ? $client :
new JHttp($this->options);
58 $this->oauth = $oauth;
70 public function getOption($key)
72 return $this->options->get($key);
85 public function setOption($key, $value)
87 $this->options->set($key, $value);
105 public function sendRequest($path, $method =
'GET', $headers = array(), $data =
'')
111 $response = $this->client->get($path, $headers);
115 $response = $this->client->post($path, $data, $headers);
120 if ($response->code != 200)
122 $error = htmlspecialchars($response->body);
124 throw new DomainException($error, $response->code);
127 $xml_string = simplexml_load_string($response->body);