public function testGetRequest() { $url = "http://api-sandbox.maestrano.io/api/v1/auth/saml/usr-1"; $client = new Maestrano_Net_HttpClient(); $resp = $client->get($url); $this->assertFalse(empty($resp)); $this->assertTrue(is_array(json_decode($resp, true))); }
/** * Fetch url and return content. Wrapper function. * * @param string full url to fetch * @return string page content */ public function fetchUrl($url, $httpClient = null) { if ($httpClient == null) { $httpClient = new Maestrano_Net_HttpClient(); } return $httpClient->get($url); }