You are reading a single comment by @Schweigi and its replies. Click here to read the full conversation.
  • It seems that the callback of require("http").request is not executed. When using require("http").get then the callback is executed. I use the Pico with 1v78. Originally I wanted to make a post request but never got a response so I tried to reproduce it with the get command.

    Remark: It looks like the forum engine injects a http:// in front of the host name.

    Callback is executed for:

    var req = require("http").get("http://www.google.c­om", function(res)  {
            console.log("status: " + res.statusCode);
    });
    

    Callback (print status code) is not executed for:

    var options = { host: "http://www.google.com" };
    var req = require("http").request(options, function(res)  {
            console.log("status: " + res.statusCode);
    });
    

    Does somebody know how to solve this?

About

Avatar for Schweigi @Schweigi started