BitbarPlugins\Travel\GeolocationAPI::call PHP Метод

call() публичный Метод

Sends a Geolocation request
public call ( GeolocationRequest $request ) : GeolocationResponse
$request GeolocationRequest
Результат GeolocationResponse
    public function call(GeolocationRequest $request)
    {
        $url = self::GEOLOCATION_URL . '?' . http_build_query(['key' => API_KEY]);
        curl_setopt($this->ch, CURLOPT_POSTFIELDS, json_encode($request));
        curl_setopt($this->ch, CURLOPT_URL, $url);
        $response = curl_exec($this->ch);
        return GeolocationResponse::fromApiResponse($response);
    }