0

I have downloaded unirest library from here and extracted it to the folder with my site. I've put this piece of code on the page:

<?php 
         require_once "/unirest-php-master/src/Unirest.php";
         $response = Unirest\Request::post("https://api4yaware-yaware-data.p.mashape.com/account/json/v2/getEmployeeLastActivity?access_key=&email=demo%2Beco%40yaware.com",
  array(
    "X-Mashape-Key" => "TSJbkryFpxmshZKbe1UxI0T9L0ddp1UFplVjsnSXjugPiVmxPd",
    "Content-Type" => "application/x-www-form-urlencoded",
    "Accept" => "text/plain"
  )
);
echo $response;
         ?>

And I'm getting this error:

Parse error: syntax error, unexpected '[' in Y:\home\localhost\www\dashboard\unirest-php-master\src\Unirest\Request.php on line 419

Screenshot:

Error screenshot

Is there a way to fix it?

  • Something is wrong on the library. Go to this file at this row and check for syntax errors. Or download a stable version of the lib. – Phiter May 23 '16 at 12:11
  • You're running an obsolete version of PHP and can't use this library until you upgrade – John Conde May 23 '16 at 12:22

0 Answers0