IP2Currency

БЕЗКОШТОВНО
(Ким) fraudlabs | Оновлено 2 years ago | Finance
Health Check

N/A

Повернутися до всіх обговорень

Catchable fatal error: Object of class Unirest\Response could not be converted to string

Rapid account: Christopherrdodd
christopherrdodd
9 years ago

Getting the following error when trying to run the API with PHP:

Catchable fatal error: Object of class Unirest\Response could not be converted to string

Here is how I am implementing it with PHP:

include_once("…/private/unirest-php/src/Unirest.php");

$dayCostUrl = “https://farebookings-free-and-real-time-currency-conversion.p.mashape.com/devel.farebookings.com/api/curconversor/THB/USD/260/json”;

dayCost=Unirest\Request::get(dayCost = Unirest\Request::get(dayCostUrl,
array(
“X-Mashape-Key” => “RBaR00xcwwmsh87WFynWrdXlO9xzp10N94YjsnKVQlAYBL0WwA”,
“Accept” => “text/plain”
)
);

echo $dayCost;

Please help me solve this issue.

Regards, Chris

Rapid account: Fraudlabs
fraudlabs Commented 9 years ago

Please see the following code for how to call IP2Currency. You will need to sign up for a free (or paid) license key at http://fraudlabs.com/ip2currency.aspx which you will need to insert into the code below.

$response = Unirest\Request::get(“https://fraudlabs-ip2currency-v1.p.mashape.com/ip2currencywebservice.asmx?LICENSE=<required>”,
array(
“X-Mashape-Key” => “mC3RMkoFezmshtpIjYXY7RO4kvyxp1NnIoKjsnxjR1UU2R3HHs”,
“Accept” => “application/xml”
)
);

Приєднуйтесь до обговорення — додайте повідомлення нижче:

Вхід / Реєстрація, щоб публікувати нові повідомлення