-
Notifications
You must be signed in to change notification settings - Fork 151
Expand file tree
/
Copy pathHttpStatusCode.php
More file actions
114 lines (102 loc) · 3.4 KB
/
HttpStatusCode.php
File metadata and controls
114 lines (102 loc) · 3.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
namespace Cloudinary\Api;
/**
* Class HttpStatusCode
*
* HTTP request status codes.
*/
class HttpStatusCode
{
/**
* The 200 (OK) status code indicates that the request has succeeded.
*
* @link https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.1
*
* @var int
*/
public const OK = 200;
/**
* The 400 (Bad Request) status code indicates that the server cannot or
* will not process the request due to something that is perceived to be a
* client error (e.g., malformed request syntax, invalid request message
* framing, or deceptive request routing).
*
* @link https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.1
*
* @var int
*/
public const BAD_REQUEST = 400;
/**
* The 401 (Unauthorized) status code indicates that the request has not
* been applied because it lacks valid authentication credentials for the
* target resource. The server generating a 401 response must send a
* WWW-Authenticate header field (Section 4.1) containing at least one
* challenge applicable to the target resource.
*
* @link https://datatracker.ietf.org/doc/html/rfc7235#section-3.1
*
* @var int
*/
public const UNAUTHORIZED = 401;
/**
* The 403 (Forbidden) status code indicates that the server understood the
* request but refuses to authorize it. A server that wishes to make public
* why the request has been forbidden can describe that reason in the
* response payload (if any).
*
* @link https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.3
*
* @var int
*/
public const FORBIDDEN = 403;
/**
* The 404 (Not Found) status code indicates that the origin server did not
* find a current representation for the target resource or is not willing
* to disclose that one exists.
*
* @link https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.4
*
* @var int
*/
public const NOT_FOUND = 404;
/**
* The 409 (Conflict) status code indicates that the request could not be
* completed due to a conflict with the current state of the target
* resource. This code is used in situations where the user might be able to
* resolve the conflict and resubmit the request. The server should generate
* a payload that includes enough information for a user to recognize the
* source of the conflict.¶
*
* @link https://datatracker.ietf.org/doc/html/rfc7231#section-6.5.8
*
* @var int
*/
public const CONFLICT = 409;
/**
* Returned when you are being rate limited.
*
* @link https://dev.twitter.com/docs/rate-limiting/1
*
* @var int
*/
public const ENHANCE_YOUR_CALM = 420;
/**
* The 429 (Too Many Requests) status code indicates the user has sent too
* many requests in a given amount of time ("rate limiting").
*
* @link https://datatracker.ietf.org/doc/html/rfc6585#section-4
*
* @var int
*/
public const TOO_MANY_REQUESTS = 429;
/**
* The 500 (Internal Server Error) status code indicates that the server
* encountered an unexpected condition that prevented it from fulfilling the
* request.
*
* @link https://datatracker.ietf.org/doc/html/rfc7231#section-6.6.1
*
* @var int
*/
public const INTERNAL_SERVER_ERROR = 500;
}