Class | HTTP::Message::Headers |
In: |
lib/httpclient/http.rb
|
Parent: | Object |
Represents HTTP message header.
STATUS_CODE_MAP | = | { Status::OK => 'OK', Status::CREATED => "Created", Status::NON_AUTHORITATIVE_INFORMATION => "Non-Authoritative Information", Status::NO_CONTENT => "No Content", Status::RESET_CONTENT => "Reset Content", Status::PARTIAL_CONTENT => "Partial Content", Status::MOVED_PERMANENTLY => 'Moved Permanently', Status::FOUND => 'Found', Status::SEE_OTHER => 'See Other', Status::TEMPORARY_REDIRECT => 'Temporary Redirect', Status::MOVED_TEMPORARILY => 'Temporary Redirect', Status::BAD_REQUEST => 'Bad Request', Status::INTERNAL => 'Internal Server Error', } | HTTP response status code to reason phrase mapping definition. | |
CHARSET_MAP | = | { 'NONE' => 'us-ascii', 'EUC' => 'euc-jp', 'SJIS' => 'shift_jis', 'UTF8' => 'utf-8', } | $KCODE to charset mapping definition. | |
NIL_URI | = | URI.parse('http://nil-uri-given/') | Placeholder URI object for nil uri. |
body_size | [R] | Size of body. nil when size is unknown (e.g. chunked response). |
chunked | [RW] | Request/Response is chunked or not. |
http_version | [RW] | HTTP version in a HTTP header. Float. |
reason_phrase | [RW] | Response only. HTTP status reason phrase. |
request_method | [R] | Request only. Requested method. |
request_query | [RW] | Request only. Requested query. |
request_uri | [RW] | Request only. Requested URI. |
request_via_proxy | [RW] | Request only. Requested via proxy or not. |
status_code | [R] | Response only. HTTP status |
Creates a Message::Headers. Use init_request, init_response, or init_connect_request for acutual initialize.
Returns an Array of headers for the given key. Each element is a pair of key and value. It returns an single element Array even if the only one header exists. If nil key given, it returns all headers.