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.

아래에 의견을 추가하고 토론에 참여하세요.

새 댓글을 게시하려면 로그인 / 가입