Apple_Push_API\Request\Request::get PHP Méthode

get() public méthode

Sends a GET request for the given article and bundles.
Since: 0.2.0
public get ( string $url ) : mixed
$url string
Résultat mixed
    public function get($url)
    {
        // Build the get request args
        $args = array('headers' => array('Authorization' => $this->sign($url, 'GET')));
        // Allow filtering and merge with the default args
        $args = apply_filters('apple_news_get_args', wp_parse_args($args, $this->default_args));
        // Perform the get
        $response = wp_safe_remote_get(esc_url_raw($url), $args);
        // Parse and return the response
        return $this->parse_response($response, true, 'get');
    }

Usage Example

 /**
  * Send a get request.
  *
  * @since 0.2.0
  * @param string $url
  * @return object
  * @access private
  */
 private function send_get_request($url)
 {
     return $this->request->get($url);
 }