Text-Processing

फ्रीमियम
द्वारा Jacob | अपडेट किया गया hace 25 días | Text Analysis
लोकप्रियता

9.5 / 10

लेटेंसी

318ms

सेवा का स्तर

100%

Health Check

N/A

सभी चर्चाओं पर वापस जाएं

Text: This field is required

Rapid account: Ajtrichards
ajtrichards
hace 10 años

I’m trying to send some text to the API for sentiment analysis but I keep getting the the error = Text: This field is required.

I’m not using the Unirest library as I’m already using another one: https://github.com/rmccue/Requests

The code i’m using is:


  $headers 	= array('Accept' => 'application/json', 'Content-Type' => 'application/json', 'X-Mashape-Authorization' => 'KEYNAME');

Requests::register_autoloader();

$data = array("text" => "Possibly sending a statement each month on what movie they have seen and how much they have saved.", "language" => "");

$request = Requests::post('https://japerk-text-processing.p.mashape.com/sentiment/', $headers, $data);

The $data is the CURL PostFields data so the text field is present. Is there something in the code above wrong? I’ve never had any other problems with this library and I don’t want to change.

Rapid account: Jroven
jroven Commented hace 5 años

Wow! Took some searching for this answer but it worked for me. Thanks.

Rapid account: Japerk
japerk Commented hace 10 años

Try doing a post without the Content-Type header

चर्चा में शामिल हों - नीचे टिप्पणी जोड़ें:

नई टिप्पणियाँ पोस्ट करने के लिए लॉग इन / साइनअप करें