HttpUtil
The @bot object presented to plugins exposes an HttpUtil object to provide a common, flexible yet simple to use interface to retrieve information from the web. Usage of the HttpUtil methods rather than custom methods guarantees automatic and consistent handling of features such as proxy usage, redirection (easy to override for plugins which are interested in the redirects themselves), caching, automatic conversion of textual data to UTF-8 (again, overridable) and decompression of compressed content.
Commonly used methods of HttpUtil are:
- get(uri, options={})
- a simple get request that will return the body of the given uri, or nil if the body couldn't be retrieved.
- head(uri, options={})
- a simple head request returning the response head, or nil if it couldn't be retrieved.
