Changing HTTP status message using Sinatra

前端 未结 2 2004
甜味超标
甜味超标 2021-01-13 12:14

I\'m writing a simple Sinatra app, and given a user posts a request with an specific data, I want to return an error \'453\' (custom error code) with a message CLIENT_ERROR,

2条回答
  •  一生所求
    2021-01-13 12:50

    I would recommend not to use custom HTTP status codes. If you think you have something of general use, consider writing an Internet Draft and going through the IETF specification process.

提交回复
热议问题