Skip to content

http.js not working with marketwatch urls

Sample URL: http://www.marketwatch.com/news/story.asp?guid=%7B21005575-02D4-D4B5-4572-D28A72DE3461%7D&siteid=rss&rss=1

Produced 301 Location: https://www.marketwatch.com/news/story.asp?guid=%7B21005575-02D4-D4B5-4572-D28A72DE3461%7D&siteid=rss&rss=1

Which produced 301 location: /story/guid/21005575-02d4-d4b5-4572-d28a72de3461?siteid=rss&rss=1

Which produced 301 location: http://www.marketwatch.com/story/the-new-york-stock-exchange-president-says-the-stock-market-is-not-a-casino-heres-what-academic-research-says-11613396805

which produced 301 Location: https://www.marketwatch.com/story/the-new-york-stock-exchange-president-says-the-stock-market-is-not-a-casino-heres-what-academic-research-says-11613396805

Which finally gives me a 200.

The code I'm using is

    var req = new HTTPRequest();
    req.follow_redirects=10;
    response = req.Get(url);
    writeln("RC: "+req.response_code);
    writeln("RS: "+req.response_status);
    writeln(response);

and RC is giving me a 404 and can't figure why.