Referrer header not found error while calling http requests from node.js

I am getting the error "message": "Referrer header not found while calling the http request from the node.js server.

The requirement is like, first I need to hit a box which accepts only the ajax requests and then route to the actual service.

Snapshot of the code

var options = {
    url: 'http://' + fullpath,
    qs : params,
    headers : {
        Cookie : "COOKIE=" + my_cookie,
        Origin: 'http://my_url',
        "X-Requested-With": 'XMLHttpRequest'
    },
    encoding : null,

};


request.get(options, function (err, response, body) {

}

Any thoughts on the above error ?

Thnx

You're not passing a Referer header to request.get and apparently the server at http://[fullpath] expects it (perhaps as a sort of misguided form of security).

Try adding one:

headers : {
    Cookie : "COOKIE=" + my_cookie,
    Origin: 'http://my_url',
    "X-Requested-With": 'XMLHttpRequest',
    Referer : 'http://' + fullpath
},