nodejs - first argument must be a string or Buffer - when using response.write with http.request

前端 未结 8 1925
难免孤独
难免孤独 2020-12-24 11:29

I\'m simply trying to create a node server that outputs the HTTP status of a given URL.

When I try to flush the response with res.write, I get the error: throw new T

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-24 11:44

    And there is another possibility (not in this case) when working with ajax(XMLhttpRequest), while sending information back to the client end you should use res.send(responsetext) instead of res.end(responsetext)

提交回复
热议问题