fetch(self,
url,
body=None,
headers=None)
This performs an HTTP POST or GET, following redirects along the
way. If a body is specified, then the request will be a POST.
Otherwise, it will be a GET.
-
- Parameters:
headers -
HTTP headers to include with the request
(type={str:str})
- Returns:
-
An object representing the server's HTTP response. If there
are network or protocol errors, an exception will be raised. HTTP
error responses, like 404 or 500, do not cause exceptions.
(type=HTTPResponse )
- Raises:
Exception -
Different implementations will raise different errors based on
the underlying HTTP library.
|