From 0fe6c3060e831caffae042eafd6f4389cedec119 Mon Sep 17 00:00:00 2001 From: NastyaGos <72504315+NastyaGos@users.noreply.github.com> Date: Mon, 12 Jul 2021 05:33:26 -0700 Subject: [PATCH] Forming url via http_build_query --- api-examples/ratesV2/index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/api-examples/ratesV2/index.php b/api-examples/ratesV2/index.php index fe69813..efe4400 100644 --- a/api-examples/ratesV2/index.php +++ b/api-examples/ratesV2/index.php @@ -55,7 +55,11 @@ switch ($_GET['action']) { case 'lists the current conversion rates between currencies': $method = 'GET'; - $apiUrl = 'https://api.coinpayments.net/api/v2/rates?from=' . $_GET['from'] . '&to=' . $_GET['to']; + $params = array( + "from" => $_GET['from'], + "to" => $_GET['to'] + ); + $apiUrl = 'https://api.coinpayments.net/api/v2/rates?' . http_build_query($params); break; }