By japerk
Updated 5 months ago
Popularity Score
Success Rate
Ahsanwani4 years ago
Error "Form Validation Errors text: This field is required."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
Ahsanwani4 years ago
Ok. Thankyou for your help.
japerk4 years ago
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.
japerk4 years ago
I'm not really familiar with PHP, but are you sure the second array parameters are the POST parameters, and not url parameters?
Ahsanwani4 years ago
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" => "************my key****************", "Content-Type" => "application/x-www-form-urlencoded", "Accept" => "application/json" ), array( "language" => "english", "text" => "great movie" ) ); echo print_r($response);
Hi Developer, feel free to post your answer:

Install SDK for NodeJS


To utilize unirest for node.js install the the npm module:

$ npm install unirest

After installing the npm package you can now start simplifying requests like so:

var unirest = require('unirest');

Creating Request

.header("X-RapidAPI-Host", "japerk-text-processing.p.rapidapi.com")
.header("X-RapidAPI-Key", "SIGN-UP-FOR-KEY")
.header("Content-Type", "application/x-www-form-urlencoded")
.send("text=California is nice")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication