I am using trying to use grammarapi using nodejs. My code seems to be fine but doesn't know why it is showing status_code =301 not 200 I have no idea how to fix it. pls, suggest some solution.
error :
trailers: {},
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 301,
statusMessage: 'Moved Permanently',
client: TLSSocket {
_tlsOptions: {
allowHalfOpen: undefined,
pipe: false,
secureContext: [SecureContext],
My code:
const express = require('express');
const https = require('https');
const app = express();
app.get("/", function(req, res){
const url = "https://www.stands4.com/services/v2/grammar.php?uid=1001&tokenid=tk324324&text=i%20loves%20you&format=json"
https.get(url, function(response){
console.log(response);
})
});
app.listen(port = 3000, function(){
console.log("Server is running on port 3000 ");
});