module Net::HTTPHeader

The HTTPHeader module provides access to HTTP headers.

The module is included in:

The headers are a hash-like collection of key/value pairs called fields.

Request and Response Fields ¶ ↑

Headers may be included in:

Exactly which fields should be sent or expected depends on the host; see:

About the Examples ¶ ↑

Fields ¶ ↑

A header field is a key/value pair.

Field Keys ¶ ↑

A field key may be:

req = Net::HTTP::Get.new(uri) req[:accept] # => "*/*" req['Accept'] # => "*/*" req['ACCEPT'] # => "*/*" req['accept'] = 'text/html' req[:accept] = 'text/html' req['ACCEPT'] = 'text/html' 

Field Values ¶ ↑

A field value may be returned as an array of strings or as a string: