RapidAPI logo

Sign Up

Log In


By japerk
Updated 2 months ago
Popularity Score
Success Rate
Ahsanwani3 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
Ahsanwani3 years ago
Ok. Thankyou for your help.
japerk3 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.
japerk3 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?
Ahsanwani3 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:
Log inSign up

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", "undefined")
.header("X-RapidAPI-Key", "undefined")
.header("Content-Type", "application/x-www-form-urlencoded")
.end(function (result) {
  console.log(result.status, result.headers, result.body);
OAuth2 Authentication
Client ID
Client Secret
OAuth2 Authentication