10 defined(
'JPATH_PLATFORM') or die;
32 $this->options = isset($options) ? $options :
new JRegistry;
36 $this->options->def(
'api.useragent',
'JMediawiki/1.0');
39 $this->options->def(
'api.timeout', 120);
52 public function get($url, array $headers = null)
55 $temp = (array) $this->options->get(
'headers');
57 foreach ($temp as $key => $val)
59 if (!isset($headers[$key]))
61 $headers[$key] = $val;
65 return $this->transport->request(
'GET',
new JUri($url), null, $headers, $this->options->get(
'api.timeout'), $this->options->get(
'api.useragent'));
79 public function post($url, $data, array $headers = null)
82 $temp = (array) $this->options->get(
'headers');
84 foreach ($temp as $key => $val)
86 if (!isset($headers[$key]))
88 $headers[$key] = $val;
92 return $this->transport->request(
'POST',
new JUri($url), $data, $headers, $this->options->get(
'api.timeout'), $this->options->get(
'api.useragent'));