Node-request - How to determine if an error occurred during the request?

前端 未结 4 1894
栀梦
栀梦 2020-12-24 12:20

I\'m trying to leverage the node-request module, but the documentation isn\'t that great. If I make a request to a valid resource and pipe it to a Writable Stream, everythin

4条回答
  •  一个人的身影
    2020-12-24 12:46

    Why not use the http module directly.http.request

    It has an 'error' event which you can use to catch the error.

提交回复
热议问题