Raises exceptions corresponding to HTTP responses