I am trying to POST some data to this API end point , Corresponding curl call is this :
curl -X POST \
-d "apiKey=YOU_API_KEY" \
-d "extractors=entities,entailments" \
-d "text=Spain's stricken Bankia expects to sell off its vast portfolio of industrial holdings that includes a stake in the parent company of British Airways and Iberia." \
https://api.textrazor.com/
If i directly try to use this with needle specifying API KEY , it connects to the API successfully but since it is missing the text
param it gives me an error. So how do I specify the multiple POST
params.
My code :
needle.post(TEXTRAZOR_URL,TEXTRAZOR_API_KEY,function(err, razorResponse){
console.log(err || razorResponse.body);
});
here TEXTRAZOR_URL
is : https://api.textrazor.com/
and TEXTRAZOR_API_KEY
is : apiKey=123123123
I know that i need to change the 2nd parameter in needle.post. How do I do this.