Class Thin::Response
In: lib/thin/response.rb
Parent: Object

A response sent to the client.

Methods

close   each   head   headers=   headers=   headers_output   new   persistent!   persistent?  

Constants

CONNECTION = 'Connection'.freeze
CLOSE = 'close'.freeze
KEEP_ALIVE = 'keep-alive'.freeze
SERVER = 'Server'.freeze
CONTENT_LENGTH = 'Content-Length'.freeze

Attributes

body  [RW]  Response body, must respond to each.
headers  [R]  Headers key-value hash
status  [RW]  Status code

Public Class methods

Public Instance methods

Close any resource used by the response

Yields each chunk of the response. To control the size of each chunk define your own each method on body.

Top header of the response, containing the status code and response headers.

Ruby 1.8 implementation. Respects Rack specs.

See rack.rubyforge.org/doc/files/SPEC.html

Ruby 1.9 doesn‘t have a String#each anymore. Rack spec doesn‘t take care of that yet, for now we just use each but fallback to each_line on strings. I wish we could remove that condition. To be reviewed when a new Rack spec comes out.

String representation of the headers to be sent in the response.

Tell the client the connection should stay open

Persistent connection must be requested as keep-alive from the server and have a Content-Length.

[Validate]