Parent

EventMachine::HttpResponseHeader

A simple hash is returned for each request made by HttpClient with the headers that were given by the server for that request.

Attributes

http_reason[RW]

The reason returned in the http response (“OK”,“File not found”,etc.)

http_version[RW]

The HTTP version returned.

http_status[RW]

The status code (as a string!)

Public Instance Methods

chunked_encoding?() click to toggle source

Is the transfer encoding chunked?

    # File lib/em-http/client.rb, line 51
51:     def chunked_encoding?
52:       /chunked/ === self[HttpClient::TRANSFER_ENCODING]
53:     end
compressed?() click to toggle source
    # File lib/em-http/client.rb, line 59
59:     def compressed?
60:       /gzip|compressed|deflate/ === self[HttpClient::CONTENT_ENCODING]
61:     end
content_length() click to toggle source

Length of content as an integer, or nil if chunked/unspecified

    # File lib/em-http/client.rb, line 40
40:     def content_length
41:       @content_length ||= ((s = self[HttpClient::CONTENT_LENGTH]) &&
42:                            (s =~ /^(\d+)$/)) ? $1.to_i : nil
43:     end
etag() click to toggle source

E-Tag

    # File lib/em-http/client.rb, line 25
25:     def etag
26:       self["ETag"]
27:     end
keep_alive?() click to toggle source
    # File lib/em-http/client.rb, line 55
55:     def keep_alive?
56:       /keep-alive/ === self[HttpClient::KEEP_ALIVE]
57:     end
last_modified() click to toggle source
    # File lib/em-http/client.rb, line 29
29:     def last_modified
30:       time = self["Last-Modified"]
31:       Time.parse(time) if time
32:     end
location() click to toggle source
    # File lib/em-http/client.rb, line 63
63:     def location
64:       self[HttpClient::LOCATION]
65:     end
status() click to toggle source

HTTP response status as an integer

    # File lib/em-http/client.rb, line 35
35:     def status
36:       Integer(http_status) rescue nil
37:     end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.