allow customizing request options globally and per host
remove unnecessary semicolon
inline local variable used only once
add extra error reporting diagnostics
Merge pull request #2 from stephenc/master

Support customized URL requests