I am using snippet code provided on mashape and my text field is not empty , What could be the problem, im using xampp local server.
Unirest\Response Object ( [code] => 400 [raw_body] => Form Validation Errors text: This field is required. [body] => Form Validation Errors text: This field is required. [headers] => Array ( [0] => HTTP/1.1 400 BAD REQUEST
加入讨论 - 在下面添加评论:
Ok. Thankyou for your help.
It does look like you’re doing the same thing as the PHP example, so maybe try contacting Mashape support about this, as they can probably help more than I can.
I’m not really familiar with PHP, but are you sure the second array parameters are the POST parameters, and not url parameters?
this is the code im using =======>
require ‘vendor/autoload.php’;
response=Unirest\Request::post("https://japerk−text−processing.p.mashape.com/sentiment/",array("X−Mashape−Key"=>"∗∗∗∗∗∗∗∗∗∗∗∗mykey∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗","Content−Type"=>"application/x−www−form−urlencoded","Accept"=>"application/json"),array("language"=>"english","text"=>"greatmovie"));echoprintr(response);