0

I've used different methods and found it difficult to integrate mashape for a dictionary..

My code is below:

require_once 'unirest-php/src/Unirest.php';
// These code snippets use an open-source library.
$response = Unirest\Request::get("https://montanaflynn-dictionary.p.mashape.com/define?word=irony",
  array(
    "X-Mashape-Key" => "T2rwS1jyBSmshKoZB5Un2kfpvgtRp1hUS9pjsnHvPoGNHIMpda",
    "Accept" => "application/json"
  )
);

What am I not getting right

Regards

2
Contributors
5
Replies
11
Views
2 Years
Discussion Span
Last Post by Prince_9
0

First, you shouldn't make your Mashape Key public
Secondly you are not doing anything with the $response variable.
Ideally you should process $response
For example try to add on line 9., empty line, var_dump($response);
You will see what the variable contains.

Best

0

I get the following error:

Fatal error: Uncaught exception 'Exception' with message ' in C:\wamp\www\81divmesselibrary\search\unirest-php\src\Unirest\Request.php on line 394

( ! ) Exception: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in C:\wamp\www\81divmesselibrary\search\unirest-php\src\Unirest\Request.php on line 394

0

This is not a Mashape's Unirest error, this is a problem with your server setup. I suggest looking into SSL issues on PHP to resolve the error. Again this is something at a deeper level than Unirest.

0

I did just that and it worked. thanks so much for your help.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.