bhttp should allow for specifying a list or range of 'unacceptable' response codes (eg. 4xx, 5xx) that should be treated and thrown as errors.
[ ] Allow specifying an array of 'error codes'.
[ ] Consider what the default for this should be.
[ ] Investigate the best API for specifying error code ranges. Perhaps just supply a few default lists, or allow predicates?
[ ] Add an option for draining the response stream when errors occur (maybe this should be default and opt-out, like for keepRedirectResponses?)
[ ] Investigate how to deal with encodeJSON for error responses; not all APIs consistently return JSON in case of errors (eg. Tahoe-LAFS, which can return plain text), and perhaps bhttp should be more lenient on this.
bhttp
should allow for specifying a list or range of 'unacceptable' response codes (eg. 4xx, 5xx) that should be treated and thrown as errors.keepRedirectResponses
?)encodeJSON
for error responses; not all APIs consistently return JSON in case of errors (eg. Tahoe-LAFS, which can return plain text), and perhapsbhttp
should be more lenient on this.