the site shows this code:
var Request = unirest.post(“https://japerk-text-processing.p.mashape.com/sentiment/”)
.headers({
“X-Mashape-Authorization”: “k9PR69i7skxNIMu1ULGbHZ3b3d4QlhB7”
})
.send({
“text”: “great movie”,
“language”: “english”
})
.end(function (response) {
console.log(response);
});
i had to change the send portion to
.send(‘text=great movie’)
to get it to work.
Join in the discussion - add comment below:
Yes, japerk only accepts
application/form-url-encoded
where unirest-nodejs by default sends objects asapplication/json
I’m trying to think of a method that doesn’t break hundreds of other apis and existing implementations using unirest.Thanks
I’ve updated unirest-nodejs to support sending FORM unless stated otherwise through usage of .type (Still unsure if this was the best action, as I cannot be sure that ALL apis support solely FORM or solely JSON or a mixture of both, changing unirest is easier than risking breaking code for tons of apis.
Thanks, I’ve alerted Mashape support.
Thanks, I’ve alerted Mashape support.