Class: RFuzz::HttpResponse
- Inherits:
-
Hash
- Object
- Hash
- RFuzz::HttpResponse
- Defined in:
- lib/rfuzz/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_body ⇒ Object
The http body of the response, in the raw.
-
#http_chunk_size ⇒ Object
When parsing chunked encodings this is set.
-
#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.
-
#raw_chunks ⇒ Object
The actual chunks taken from the chunked encoding.
Instance Method Summary collapse
-
#chunk_size ⇒ Object
Converts the http_chunk_size string properly.
-
#chunked_encoding? ⇒ Boolean
Easier way to find out if this is a chunked encoding.
-
#last_chunk? ⇒ Boolean
true if this is the last chunk, nil otherwise (false).
Instance Attribute Details
#http_body ⇒ Object
The http body of the response, in the raw
26 27 28 |
# File 'lib/rfuzz/client.rb', line 26 def http_body @http_body end |
#http_chunk_size ⇒ Object
When parsing chunked encodings this is set
29 30 31 |
# File 'lib/rfuzz/client.rb', line 29 def http_chunk_size @http_chunk_size end |
#http_reason ⇒ Object
The reason returned in the http response (“OK”,“File not found”,etc.)
17 18 19 |
# File 'lib/rfuzz/client.rb', line 17 def http_reason @http_reason end |
#http_status ⇒ Object
The status code (as a string!)
23 24 25 |
# File 'lib/rfuzz/client.rb', line 23 def http_status @http_status end |
#http_version ⇒ Object
The HTTP version returned.
20 21 22 |
# File 'lib/rfuzz/client.rb', line 20 def http_version @http_version end |
#raw_chunks ⇒ Object
The actual chunks taken from the chunked encoding
32 33 34 |
# File 'lib/rfuzz/client.rb', line 32 def raw_chunks @raw_chunks end |
Instance Method Details
#chunk_size ⇒ Object
Converts the http_chunk_size string properly
35 36 37 38 39 40 41 |
# File 'lib/rfuzz/client.rb', line 35 def chunk_size if @chunk_size == nil @chunk_size = @http_chunk_size ? @http_chunk_size.to_i(base=16) : 0 end @chunk_size end |
#chunked_encoding? ⇒ Boolean
Easier way to find out if this is a chunked encoding
49 50 51 |
# File 'lib/rfuzz/client.rb', line 49 def chunked_encoding? /chunked/i === self[HttpClient::TRANSFER_ENCODING] end |
#last_chunk? ⇒ Boolean
true if this is the last chunk, nil otherwise (false)
44 45 46 |
# File 'lib/rfuzz/client.rb', line 44 def last_chunk? @last_chunk || chunk_size == 0 end |