Unirest\Request::get PHP Method

get() public static method

Send a GET request to a URL
public static get ( string $url, array $headers = [], mixed $parameters = null, string $username = null, string $password = null ) : unirest\Response
$url string URL to send the GET request to
$headers array additional headers to send
$parameters mixed parameters to send in the querystring
$username string Authentication username (deprecated)
$password string Authentication password (deprecated)
return unirest\Response
    public static function get($url, $headers = array(), $parameters = null, $username = null, $password = null)
    {
        return self::send(Method::GET, $url, $parameters, $headers, $username, $password);
    }

Usage Example

 /**
  * @param string|array $param Options or ID
  * @return \stdClass
  */
 public function fetch($param)
 {
     if (is_string($param)) {
         return new Payment($this->response(Request::get(Endpoints::fetch($param))->raw_body));
     } else {
         $response = json_decode(Request::get(Endpoints::fetch($param))->raw_body, true);
         $json['entity'] = "collection";
         foreach ($response as $key => $item) {
             $json['items'][$key] = new Payment($this->response($item));
         }
         return $this->response($json);
     }
 }
All Usage Examples Of Unirest\Request::get