TextAnalysis

फ्रीमियम
द्वारा TextMiner | अपडेट किया गया 21 days ago | Tools
लोकप्रियता

9 / 10

लेटेंसी

293ms

सेवा का स्तर

100%

Health Check

N/A

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

Demo not working

Rapid account: Yzini
yzini
9 years ago

I use the demo code for node.js and get the following response:
400 { ‘content-type’: ‘text/html’,
date: ‘Wed, 10 Dec 2014 13:46:37 GMT’,
server: ‘Mashape/5.0.5’,
‘x-ratelimit-requests-limit’: ‘1000’,
‘x-ratelimit-requests-remaining’: ‘996’,
‘content-length’: ‘192’,
connection: ‘keep-alive’ } ‘<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 3.2 Final//EN”>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>The browser (or proxy) sent a request that this server could not understand.</p>\n’

Rapid account: Textanalysis
textanalysis Commented 9 years ago

close it now, thanks

Rapid account: Textanalysis
textanalysis Commented 9 years ago

After reading the Unirest Node Js document and test the node code again, I have found the bug. You should change:

.header(“Content-Type”, “application/x-www-form-urlencoded”)
==>
.header(“Accept”, “application/x-www-form-urlencoded”)

The whole example code like this:

var unirest = require(‘unirest’);

unirest.post(“https://textanalysis.p.mashape.com/mbsp-word-lemmatize”)
.header(“X-Mashape-Key”, “Your mashape api key”)
.header(“Accept”, “application/x-www-form-urlencoded”)
.field(“text”, “this is word lemmatize test”)
.end(function (result) {
console.log(result.status, result.headers, result.body);
});

Rapid account: Textanalysis
textanalysis Commented 9 years ago

Sorry, I’m not familar with Node js and test it with the document code, and found the same error like yours. The code generated by Mashape platform, and I can’t find why it’s wrong now. But test it with the curl and python, I get right response. The problem seems caused by the unirest node js library.

Rapid account: Yzini
yzini Commented 9 years ago

I copy paste the demo code for node js

Rapid account: Textanalysis
textanalysis Commented 9 years ago

can you tell me which api you called? thanks

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

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