HTTPUtils provides utility methods for working with the HTTP protocol.

This module is generally used internally by WEBrick

Constants

Default mime types

Class Methods

Removes quotes and escapes from str

Loads Apache-compatible mime.types in file.

Returns the mime type of filename from the list in mime_tab. If no mime type was found application/octet-stream is returned.

Normalizes a request path. Raises an exception if the path cannot be normalized.

Parses form data in io with the given boundary

Parses an HTTP header raw into a hash of header fields with an Array of values.

Parses the query component of a URI in str

Parses q values in value as used in Accept headers.

Parses a Range header value ranges_specifier

Quotes and escapes quotes in str

Splits a header value str according to HTTP specification.

Instance Methods

Removes quotes and escapes from str

Escapes HTTP reserved and unwise characters in str

Escapes 8 bit characters in str

Escapes form reserved characters in str

Escapes path str

Loads Apache-compatible mime.types in file.

Returns the mime type of filename from the list in mime_tab. If no mime type was found application/octet-stream is returned.

Normalizes a request path. Raises an exception if the path cannot be normalized.

Parses form data in io with the given boundary

Parses an HTTP header raw into a hash of header fields with an Array of values.

Parses the query component of a URI in str

Parses q values in value as used in Accept headers.

Parses a Range header value ranges_specifier

Quotes and escapes quotes in str

Splits a header value str according to HTTP specification.

Unescapes HTTP reserved and unwise characters in str

Unescapes form reserved characters in str