Text-Processing

免费增值
通过 Jacob | 已更新 한 달 전 | Text Analysis
人气

9.5 / 10

延迟

318ms

服务等级

100%

Health Check

N/A

返回所有讨论

Sentiment Analysis

Rapid account: Massblurb
Massblurb
9년 전

Hi,
This is Tushar
I’m sending the following request from my php code

$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”
)
);

and getting the code 400 (Form Validation Errors text: This field is required.) in response.
Can you please help?

Rapid account: Massblurb
Massblurb Commented 9년 전

Hi,
Could not use the traditional php request at that time so had resolved the problem by using a curl request as follows -
$response = exec(“curl -X POST --include ‘https://japerk-text-processing.p.mashape.com/sentiment/
-H 'X-Mashape-Key: ’
-H ‘Content-Type: application/x-www-form-urlencoded’
-H ‘Accept: application/json’
-d ‘language=english’
-d 'text=”. $tweet ."’");

Rapid account: Japerk
japerk Commented 9년 전

I’m not familiar with PHP or the PHP Unirest API, but it looks like the second array is not being sent as the POST data. Maybe it needs to be sent as another parameter or argument.

加入讨论 - 在下面添加评论:

登录/注册以发布新的评论