Class: Rev::HttpResponseHeader
- Inherits:
-
Hash
- Object
- Hash
- Rev::HttpResponseHeader
- Defined in:
- lib/rev/http_client.rb
Overview
A simple hash is returned for each request made by HttpClient with the headers that were given by the server for that request.
Instance Attribute Summary collapse
-
#http_reason ⇒ Object
The reason returned in the http response (“OK”,“File not found”,etc.).
-
#http_status ⇒ Object
The status code (as a string!).
-
#http_version ⇒ Object
The HTTP version returned.
Instance Method Summary collapse
-
#chunked_encoding? ⇒ Boolean
Is the transfer encoding chunked?.
-
#content_length ⇒ Object
Length of content as an integer, or nil if chunked/unspecified.
-
#status ⇒ Object
HTTP response status as an integer.
Instance Attribute Details
#http_reason ⇒ Object
The reason returned in the http response (“OK”,“File not found”,etc.)
15 16 17 |
# File 'lib/rev/http_client.rb', line 15 def http_reason @http_reason end |
#http_status ⇒ Object
The status code (as a string!)
21 22 23 |
# File 'lib/rev/http_client.rb', line 21 def http_status @http_status end |
#http_version ⇒ Object
The HTTP version returned.
18 19 20 |
# File 'lib/rev/http_client.rb', line 18 def http_version @http_version end |
Instance Method Details
#chunked_encoding? ⇒ Boolean
Is the transfer encoding chunked?
34 35 36 |
# File 'lib/rev/http_client.rb', line 34 def chunked_encoding? /chunked/i === self[HttpClient::TRANSFER_ENCODING] end |
#content_length ⇒ Object
Length of content as an integer, or nil if chunked/unspecified
29 30 31 |
# File 'lib/rev/http_client.rb', line 29 def content_length Integer(self[HttpClient::CONTENT_LENGTH]) rescue nil end |
#status ⇒ Object
HTTP response status as an integer
24 25 26 |
# File 'lib/rev/http_client.rb', line 24 def status Integer(http_status) rescue nil end |