Jeannie

FREEMIUM
By pannous | Updated 5日前 | Communication
Popularity

0.1 / 10

Latency

127,552ms

Service Level

0%

Health Check

N/A

Back to All Discussions

No answer?

Rapid account: Sorent
sorent
10年前

I get the following error:
HTTP ERROR 500

Problem accessing /api/api. Reason:

Problem while creating output

Powered by Jetty://

When I use your example code:
require_once ‘./unirest-php/lib/Unirest.php’;
$response = Unirest::get(
https://siri.p.mashape.com/api?input=who created you&timeZone=%2B120&locale=en&page=1&location=53.0%2C9.0&clientFeatures=all”,
array(
“X-Mashape-Authorization” => “QyDwbJaIk9hpLkaeNzbDI2OgfClZ7C4y”
),
null
);
echo $response->raw_body;

Rapid account: Pannous
pannous Commented 10年前

Sorry for the very late reply!

It seems like indeed the auto-generated PHP code is broken, we will report this issue to mashape.

In the meantime this code should work for you:

<?
require_once ‘./unirest-php/lib/Unirest.php’;

function download($url)
{
ch=curlinit();curlsetopt(ch = curl_init(); curl_setopt(ch, CURLOPT_URL, url);curlsetopt(url); curl_setopt(ch, CURLOPT_HTTPHEADER, array("X-Mashape-Authorization: ". “QyDwbJaIk9hpLkaeNzbDI2OgfClZ7C4y”));
responseBody=curlexec(responseBody = curl_exec(ch);
curl_close($ch);
return $responseBody;
}

url = "https://jeannie.p.mashape.com/text/?input=Howdy&locale=en&location=50.3%2C9.0&clientFeatures=all&timeZone=%2B120&out=simple"; response = download($url);// OK
// response=Unirest::get(response = Unirest::get(url, array( “X-Mashape-Authorization” => “QyDwbJaIk9hpLkaeNzbDI2OgfClZ7C4y” ), null ); // BROKEN!?
echo $response->raw_body;
?>

Join in the discussion - add comment below:

Login / Signup to post new comments