How to send a custom http status message in node / express?

前端 未结 9 734
我寻月下人不归
我寻月下人不归 2020-12-12 16:24

My node.js app is modeled like the express/examples/mvc app.

In a controller action I want to spit out a HTTP 400 status with a custom http message. By default the

9条回答
  •  旧巷少年郎
    2020-12-12 16:33

    Well in the case of Restify we should use sendRaw() method

    Syntax is: res.sendRaw(200, 'Operation was Successful', or null)

提交回复
热议问题