Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of available Rails http headers (like ":success", ":created", and ":bad_request"). Where is it?

You can use head to build header-only responses. The Rails guide is very helpful in pointing out that you can send a :bad_request or :created header. Where is a list of all of these Rails HTTP header aliases?

like image 391
chadoh Avatar asked Jul 26 '11 22:07

chadoh


1 Answers

Have a look at Rack::Utils::HTTP_STATUS_CODES, it's used by Rails to set the status codes. To have the symbol, just "downcase" and "underscore" the hash values.

like image 76
moritz Avatar answered Oct 18 '22 11:10

moritz



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!