Overview

Packages

  • Requests
    • Authentication
    • Cookies
    • Proxy
    • Session
    • Transport
    • Utilities

Classes

  • Requests
  • Requests_Response
  • Requests_Response_Headers

Exceptions

  • Requests_Exception
  • Requests_Exception_HTTP
  • Requests_Exception_HTTP_304
  • Requests_Exception_HTTP_305
  • Requests_Exception_HTTP_306
  • Requests_Exception_HTTP_400
  • Requests_Exception_HTTP_401
  • Requests_Exception_HTTP_402
  • Requests_Exception_HTTP_403
  • Requests_Exception_HTTP_404
  • Requests_Exception_HTTP_405
  • Requests_Exception_HTTP_406
  • Requests_Exception_HTTP_407
  • Requests_Exception_HTTP_408
  • Requests_Exception_HTTP_409
  • Requests_Exception_HTTP_410
  • Requests_Exception_HTTP_411
  • Requests_Exception_HTTP_412
  • Requests_Exception_HTTP_413
  • Requests_Exception_HTTP_414
  • Requests_Exception_HTTP_415
  • Requests_Exception_HTTP_416
  • Requests_Exception_HTTP_417
  • Requests_Exception_HTTP_418
  • Requests_Exception_HTTP_428
  • Requests_Exception_HTTP_429
  • Requests_Exception_HTTP_431
  • Requests_Exception_HTTP_500
  • Requests_Exception_HTTP_501
  • Requests_Exception_HTTP_502
  • Requests_Exception_HTTP_503
  • Requests_Exception_HTTP_504
  • Requests_Exception_HTTP_505
  • Requests_Exception_HTTP_511
  • Requests_Exception_HTTP_Unknown
  • Requests_Exception_Transport
  • Requests_Exception_Transport_cURL
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated

Warning! You are currently reading the documentation for Requests 1.x.

It is recommended to upgrade to Requests 2.x at your earliest convenience. Upgrading to Requests 2.x is fairly straight-forward.
A full list of the changes can be found in the Changelog.

Visit the documentation for Requests_Exception_HTTP in Requests 2.x.

Class Requests_Exception_HTTP

Exception based on HTTP response

Exception
Extended by Requests_Exception
Extended by Requests_Exception_HTTP

Direct known subclasses

Requests_Exception_HTTP_304, Requests_Exception_HTTP_305, Requests_Exception_HTTP_407, Requests_Exception_HTTP_408, Requests_Exception_HTTP_409, Requests_Exception_HTTP_410, Requests_Exception_HTTP_411, Requests_Exception_HTTP_412, Requests_Exception_HTTP_413, Requests_Exception_HTTP_414, Requests_Exception_HTTP_415, Requests_Exception_HTTP_416, Requests_Exception_HTTP_306, Requests_Exception_HTTP_417, Requests_Exception_HTTP_418, Requests_Exception_HTTP_428, Requests_Exception_HTTP_429, Requests_Exception_HTTP_431, Requests_Exception_HTTP_500, Requests_Exception_HTTP_501, Requests_Exception_HTTP_502, Requests_Exception_HTTP_503, Requests_Exception_HTTP_504, Requests_Exception_HTTP_400, Requests_Exception_HTTP_505, Requests_Exception_HTTP_511, Requests_Exception_HTTP_Unknown, Requests_Exception_HTTP_401, Requests_Exception_HTTP_402, Requests_Exception_HTTP_403, Requests_Exception_HTTP_404, Requests_Exception_HTTP_405, Requests_Exception_HTTP_406
Package: Requests
Located at Requests/Exception/HTTP.php
Methods summary
public
# __construct( string|null $reason = null, mixed $data = null )

Create a new exception

Create a new exception

There is no mechanism to pass in the status code, as this is set by the subclass used. Reason phrases can vary, however.

Parameters

$reason
Reason phrase
$data
Associated data

Overrides

Requests_Exception::__construct()
public
# getReason( )

Get the status message

Get the status message

public static string
# get_class( integer|boolean $code )

Get the correct exception class for a given error code

Get the correct exception class for a given error code

Parameters

$code
HTTP status code, or false if unavailable

Returns

string
Exception class name to use
Methods inherited from Requests_Exception
getData(), getType()
Methods inherited from Exception
__toString(), __wakeup(), getCode(), getFile(), getLine(), getMessage(), getPrevious(), getTrace(), getTraceAsString()
Properties summary
protected integer $code

HTTP status code

HTTP status code

# 0
protected string $reason

Reason phrase

Reason phrase

# 'Unknown'
Properties inherited from Requests_Exception
$data, $type
Properties inherited from Exception
$file, $line, $message
Requests 1.8.1 API Documentation API documentation generated by ApiGen