Debug output in http/https get

Posted on
  • I'm not sure if this is the usual output. I can't recall seeing this in the past - the httpCRq object is dumped.

    Perhaps related to @opichals socket changes?

    make clean && RELEASE=1 make
    var http = require("http");
    http.get("", function(res) {
      res.on('data', function(data) {
    =httpCRq { "type": 5,
      "#onconnect": function (res) { ... },
      "res": httpCRs {  },
      "opt": {
        "protocol": "https:",
        "method": "GET",
        "host": "",
        "path": "/",
        "pathname": "/",
        "search": null, "port": null, "query": null },
      "dSnd": "GET / HTTP/1.1\r\nU" ... "\r\n\r\n",
      "sckt": 4 }
    <HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
    <TITLE>302 Moved</TITLE></HEAD><BO
    <H1>302 Moved</H1>
    The document has moved
    <A HREF="­r&amp;dcr=0&amp;ei=aTgyWs_3F4rr8we175iYA­Q">here</A>.
  • Did you copy&paste that into the console? If so I think that's what you'd expect - since the result of http.get will be a http request object, which gets printed with =.

  • Ah - yes into the left side of the ide.

    Thanks for the explanation!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Debug output in http/https get

Posted by Avatar for Wilberforce @Wilberforce