I have the below lines in my code:
postUrl = "http://www.nytimes.com/2014/03/08/world/asia/ malaysia-airlines-says-plane-with-over-200-aboard-is-missing.html";
var htmlResult = cheerio.load(Meteor.http.call("GET", postUrl, {options: {followRedirects:false}}).content);
I get the following error:
Error: Exceeded maxRedirects. Probably stuck in a redirect loop
I try the same code with other URL and it works but It's throwing this exception with the NTY url. I'm basically trying to get the HEAD of the page.
Use this.
In your http.get
call you should pass {jar: true}
For example:
HTTP.get(url, {jar: true})
This worked for me at least :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With