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

Request takes a callback method, its async! So I am assuming, by the time the callback is executed the res.end() might get called. Try closing the request within the callback.

Leave a Comment