search

Home  >  Q&A  >  body text

How to set boolean value true in php curl

How to set fixed_rate boolean true

in this php curl

fixed_rate (optional) - Boolean value, can be true or false. Returns available currencies and minimum and maximum exchange amounts.

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://api.nowpayments.io/v1/currencies',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_HTTPHEADER => array(
    'x-api-key: <your_api_key>'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

P粉344355715P粉344355715237 days ago503

reply all(1)I'll reply

  • P粉493534105

    P粉4935341052024-03-31 00:29:24

    CURLOPT_URL => 'https://api.nowpayments.io/v1/currencies?fixed_rate=true',

    You should set the flat rate as a parameter of url.

    reply
    0
  • Cancelreply