Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send a 404 (or another specific) HTTP error in Lift?

As my web application is currently a REST-only system (with no pages meant for user view) I'd like to send a 404 HTTP error when index page is requested. How to do this in Lift?

like image 621
Ivan Avatar asked Feb 01 '26 20:02

Ivan


1 Answers

Does this work for you?

serve {
  case XmlPut("order" :: orderId :: Nil, (_, _)) =>
    Full(NotFoundResponse())
}

... or just Empty box. With an empty box later serve blocks may override.

like image 187
thoredge Avatar answered Feb 04 '26 15:02

thoredge



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!