This has to be a dumb mistake on my part but I’m just not seeing it. I’ve tested the API via Postman and it worked great. I then tried some simple Node code:
const rp = require('request-promise');
rp({
uri:'https://languagetool.org/api/v2/check',
method:'POST',
formData:{
'text':'hello world',
'language':'auto',
'disabledRules':'EN_QUOTES'
},
headers:{
'Content-Type': 'application/x-www-form-urlencoded'
}
})
.then(res => {
console.log('res',res);
})
.catch(e => {
console.log('error calling api',e.message);
});
Pardon the indentation there. Anyway - I always get an error saying that I didn’t pass text or data. When I switch my end point to the Postman Echo service, I clearly see the form fields as being passed. Any ideas?