4 Exception handling
Given an HTTP response’s headers
, return a
constructed with information from the response.
Convenience: Given an input-port?
and response headers as a
check the headers. Unless HTTP the status code is one of 200,
206, 301, 302, or 307, read the XML response body from the port and raise an
constructed with information from the reponse.
Otherwise, return headers
and the caller may read the response entity
Note: This does not close the input port in before raising an
exception. It assumes you are using call/requests,
call/input-request, or call/output-request from the
http/request library (or using dynamic-wind or other
exception handling, or a custodian—or whatever) to make sure the port is