api_key = $api_key; $this->endpoint = $endpoint; } function addressian_get_response($param, ...$resources) { $url = $this->endpoint . "/" . implode("/", $resources) . "?" . http_build_query($param); $response = wp_remote_get($url, array('headers' => array('x-api-key' => $this->api_key, 'Origin' => "woo:1.4:" . get_site_url()))); $body = wp_remote_retrieve_body($response); return $body; } }