I am trying to make a GET request to a certain url that returns a VAST tag. When I curl the url, curl -v 'http://a.host.for.vasttag.com/foo/ad.jsp?fooid=someidhere'
I receive normal html like this:
<script type="text/javascript" src="foobar.js"></script><script type="text/javascript">var FOO_customization = {"account":"foo1","playerid":"foo1232","inapp":"true","domain":"foodomain.com"}</script><script type="text/javascript" id="exampleBanner" src="http://this.is.net/banner/LATEST/inbanner.min.js"></script>
I would like to receive the same response in my node.app, but I only receive this:
<?xml version="1.0" encoding="utf-8"?> <VAST version="3.0"></VAST>
What did I do wrong? Here is my code:
var http = require('http')
var options = {
method : 'GET',
host: 'a.host.for.vasttag.com',
port: 80,
path: '/foo/ad.jsp?fooid=someidhere',
headers: {'Content-Type': 'text/html'},
}
http.get(options, function(res) {
console.log("Got response: " + res.statusCode)
res.on("data", function(chunk) {
console.log(chunk)
})
}).on('error', function(e) {
console.log("Got error: " + e.message)
})