get() public method

API call method for sending requests using GET
public get ( string $path, array $data = null ) : mixed
$path string Path of the endpoint
$data array Data to be sent along with the request
return mixed
Example #1
0
 public function testHttpGetMethodSet()
 {
     $api = new Api('*****@*****.**', 'Auth Key');
     $result = $api->get('test');
     $this->assertEquals("get", $result['method']);
 }
Example #2
0
 public function testInvalidAuthenticationWithInvalidParameters()
 {
     self::setExpectedException(AuthenticationException::class);
     $api = new Api('foo.domain.tld', 'KEY');
     $api->get('/bogus', []);
 }