Skip to content

Commit 419817d

Browse files
authored
Merge pull request #341 from joshtriplett/fix-status-code-docs
Fix status code 4xx documentation to have the right descriptions
2 parents e7edb1d + 1b3bbe0 commit 419817d

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

src/status_code.rs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -147,38 +147,32 @@ pub enum StatusCode {
147147
/// 400 Bad Request
148148
///
149149
/// The server could not understand the request due to invalid syntax.
150+
BadRequest = 400,
151+
152+
/// 401 Unauthorized
150153
///
151154
/// Although the HTTP standard specifies "unauthorized", semantically this
152155
/// response means "unauthenticated". That is, the client must
153156
/// authenticate itself to get the requested response.
154-
BadRequest = 400,
157+
Unauthorized = 401,
155158

156-
/// 401 Unauthorized
159+
/// 402 Payment Required
157160
///
158161
/// This response code is reserved for future use. The initial aim for
159162
/// creating this code was using it for digital payment systems, however
160163
/// this status code is used very rarely and no standard convention
161164
/// exists.
162-
Unauthorized = 401,
165+
PaymentRequired = 402,
163166

164-
/// 402 Payment Required
167+
/// 403 Forbidden
165168
///
166169
/// The client does not have access rights to the content; that is, it is
167170
/// unauthorized, so the server is refusing to give the requested
168171
/// resource. Unlike 401, the client's identity is known to the server.
169-
PaymentRequired = 402,
170-
171-
/// 403 Forbidden
172-
///
173-
/// The server can not find requested resource. In the browser, this means
174-
/// the URL is not recognized. In an API, this can also mean that the
175-
/// endpoint is valid but the resource itself does not exist. Servers
176-
/// may also send this response instead of 403 to hide the existence of
177-
/// a resource from an unauthorized client. This response code is probably
178-
/// the most famous one due to its frequent occurrence on the web.
179172
Forbidden = 403,
180173

181174
/// 404 Not Found
175+
///
182176
/// The server can not find requested resource. In the browser, this means
183177
/// the URL is not recognized. In an API, this can also mean that the
184178
/// endpoint is valid but the resource itself does not exist. Servers

0 commit comments

Comments
 (0)