celluloid / reel

UNMAINTAINED: See celluloid/celluloid#779 - Celluloid::IO-powered web server
https://celluloid.io
MIT License
595 stars 87 forks source link

Make response status a little more sane. #1

Closed seancribbs closed 12 years ago

seancribbs commented 12 years ago

It was nigh impossible to set a response other than 200 OK before, but now it's easy. This doesn't yet solve the problem of setting an alternative reason string, but that's a very uncommonly used feature.

Reel::Server.new("0.0.0.0", 3000).new do |connection|
  # Use an integer status code
  connection.respond 204
  # Or a status symbol
  connection.respond :no_content
end