Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
class HTTPLengthRequired(HTTPClientError):
"""HTTP/411 - Length Required"""
status_code = 411
class HTTPPreconditionFailed(HTTPClientError):
"""HTTP/412 - Precondition Failed"""
status_code = 412
class HTTPPayloadTooLarge(HTTPClientError):
"""HTTP/413 - Payload Too Large"""
status_code = 413
class HTTPURITooLong(HTTPClientError):
"""HTTP/414 - URI Too Long"""
status_code = 414
class HTTPUnsupportedMediaType(HTTPClientError):
"""HTTP/415 - Unsupported Media Type"""
status_code = 415
class HTTPRangeNotSatisfiable(HTTPClientError):
"""HTTP/416 - Range Not Satisfiable"""
status_code = 416
class HTTPExpectationFailed(HTTPClientError):
"""HTTP/417 - Expectation Failed"""
status_code = 403
class HTTPNotFound(HTTPClientError):
status_code = 404
class HTTPMethodNotAllowed(HTTPClientError):
status_code = 405
class HTTPNotAcceptable(HTTPClientError):
status_code = 406
class HTTPProxyAuthenticationRequired(HTTPClientError):
status_code = 407
class HTTPRequestTimeout(HTTPClientError):
status_code = 408
class HTTPConflict(HTTPClientError):
status_code = 409
class HTTPGone(HTTPClientError):
status_code = 410
class HTTPLengthRequired(HTTPClientError):
status_code = 417
class HTTPMisdirectedRequest(HTTPClientError):
status_code = 421
class HTTPUnprocessableEntity(HTTPClientError):
status_code = 422
class HTTPLocked(HTTPClientError):
status_code = 423
class HTTPFailedDependency(HTTPClientError):
status_code = 424
class HTTPUpgradeRequired(HTTPClientError):
status_code = 426
class HTTPPreconditionRequired(HTTPClientError):
status_code = 428
class HTTPTooManyRequests(HTTPClientError):
status_code = 429
class HTTPRequestHeaderFieldsTooLarge(HTTPClientError):
class HTTPRequestTimeout(HTTPClientError):
"""HTTP/408 - Request Timeout"""
status_code = 408
class HTTPConflict(HTTPClientError):
"""HTTP/409 - Conflict"""
status_code = 409
class HTTPGone(HTTPClientError):
"""HTTP/410 - Gone"""
status_code = 410
class HTTPLengthRequired(HTTPClientError):
"""HTTP/411 - Length Required"""
status_code = 411
class HTTPPreconditionFailed(HTTPClientError):
"""HTTP/412 - Precondition Failed"""
status_code = 412
class HTTPPayloadTooLarge(HTTPClientError):
"""HTTP/413 - Payload Too Large"""
status_code = 413
class HTTPURITooLong(HTTPClientError):
"""HTTP/414 - URI Too Long"""
class HTTPUseProxy(HTTPRedirection):
"""HTTP/305 - Use Proxy"""
status_code = 305
class HTTPTemporaryRedirect(HTTPRedirection):
"""HTTP/307 - Temporary Redirect"""
status_code = 307
class HTTPPermanentRedirect(HTTPRedirection):
"""HTTP/308 - Permanent Redirect"""
status_code = 308
class HTTPBadRequest(HTTPClientError):
"""HTTP/400 - Bad Request"""
status_code = 400
class HTTPUnauthorized(HTTPClientError):
"""HTTP/401 - Unauthorized"""
status_code = 401
class HTTPPaymentRequired(HTTPClientError):
"""HTTP/402 - Payment Required"""
status_code = 402
class HTTPForbidden(HTTPClientError):
"""HTTP/403 - Forbidden"""
class HTTPServerError(HTTPError):
"""5xx responses."""
# The follow are based on the HTTP Status Code Registery at
# http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml
class HTTPBadRequest(HTTPClientError):
status_code = 400
class HTTPUnauthorized(HTTPClientError):
status_code = 401
class HTTPPaymentRequired(HTTPClientError):
status_code = 402
class HTTPForbidden(HTTPClientError):
status_code = 403
class HTTPNotFound(HTTPClientError):
status_code = 404
class HTTPMethodNotAllowed(HTTPClientError):
status_code = 405
class HTTPNotAcceptable(HTTPClientError):
status_code = 426
class HTTPPreconditionRequired(HTTPClientError):
status_code = 428
class HTTPTooManyRequests(HTTPClientError):
status_code = 429
class HTTPRequestHeaderFieldsTooLarge(HTTPClientError):
status_code = 431
class HTTPUnavailableForLegalReasons(HTTPClientError):
status_code = 451
class HTTPInternalServerError(HTTPServerError):
status_code = 500
class HTTPNotImplemented(HTTPServerError):
status_code = 501
class HTTPBadGateway(HTTPServerError):
status_code = 502
class HTTPServiceUnavailable(HTTPServerError):
class HTTPExpectationFailed(HTTPClientError):
"""HTTP/417 - Expectation Failed"""
status_code = 417
class HTTPMisdirectedRequest(HTTPClientError):
"""HTTP/421 - Misdirected Request"""
status_code = 421
class HTTPUnprocessableEntity(HTTPClientError):
"""HTTP/422 - Unprocessable Entity"""
status_code = 422
class HTTPLocked(HTTPClientError):
"""HTTP/423 - Locked"""
status_code = 423
class HTTPFailedDependency(HTTPClientError):
"""HTTP/424 - Failed Dependency"""
status_code = 424
class HTTPUpgradeRequired(HTTPClientError):
"""HTTP/426 - Upgrade Required"""
status_code = 426
class HTTPPreconditionRequired(HTTPClientError):
"""HTTP/428 - Precondition Required"""
class HTTPMisdirectedRequest(HTTPClientError):
"""HTTP/421 - Misdirected Request"""
status_code = 421
class HTTPUnprocessableEntity(HTTPClientError):
"""HTTP/422 - Unprocessable Entity"""
status_code = 422
class HTTPLocked(HTTPClientError):
"""HTTP/423 - Locked"""
status_code = 423
class HTTPFailedDependency(HTTPClientError):
"""HTTP/424 - Failed Dependency"""
status_code = 424
class HTTPUpgradeRequired(HTTPClientError):
"""HTTP/426 - Upgrade Required"""
status_code = 426
class HTTPPreconditionRequired(HTTPClientError):
"""HTTP/428 - Precondition Required"""
status_code = 428
class HTTPTooManyRequests(HTTPClientError):
"""HTTP/429 - Too Many Requests"""
status_code = 413
class HTTPURITooLong(HTTPClientError):
status_code = 414
class HTTPUnsupportedMediaType(HTTPClientError):
status_code = 415
class HTTPRangeNotSatisfiable(HTTPClientError):
status_code = 416
class HTTPExpectationFailed(HTTPClientError):
status_code = 417
class HTTPMisdirectedRequest(HTTPClientError):
status_code = 421
class HTTPUnprocessableEntity(HTTPClientError):
status_code = 422
class HTTPLocked(HTTPClientError):
status_code = 423
class HTTPFailedDependency(HTTPClientError):