Class: ICAPrb::Server::HTTP_Header
- Inherits:
-
Hash
- Object
- Hash
- ICAPrb::Server::HTTP_Header
- Defined in:
- lib/icaprb/server/data_structures.rb
Overview
This class is the base for the HTTP header classes. It is a subclass of Hash.
Direct Known Subclasses
Instance Method Summary collapse
-
#to_s ⇒ Object
Converts the array to a
Stringand which will be the complete HTTP Header, witch contains the request or status line.
Instance Method Details
#to_s ⇒ Object
Converts the array to a String and which will be the complete HTTP Header, witch contains the request or status line.
It will join the headers with \r\n and ends with \r\n\r\n
29 30 31 32 33 34 35 |
# File 'lib/icaprb/server/data_structures.rb', line 29 def to_s data = [] each do |key, value| data << "#{key}: #{value}" end request_line + data.join("\r\n") + "\r\n\r\n" end |