Skip to content

Commit

Permalink
Merge pull request #341 from joshtriplett/fix-status-code-docs
Browse files Browse the repository at this point in the history
Fix status code 4xx documentation to have the right descriptions
  • Loading branch information
yoshuawuyts authored Feb 25, 2021
2 parents e7edb1d + 1b3bbe0 commit 419817d
Showing 1 changed file with 8 additions and 14 deletions.
22 changes: 8 additions & 14 deletions src/status_code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,38 +147,32 @@ pub enum StatusCode {
/// 400 Bad Request
///
/// The server could not understand the request due to invalid syntax.
BadRequest = 400,

/// 401 Unauthorized
///
/// Although the HTTP standard specifies "unauthorized", semantically this
/// response means "unauthenticated". That is, the client must
/// authenticate itself to get the requested response.
BadRequest = 400,
Unauthorized = 401,

/// 401 Unauthorized
/// 402 Payment Required
///
/// This response code is reserved for future use. The initial aim for
/// creating this code was using it for digital payment systems, however
/// this status code is used very rarely and no standard convention
/// exists.
Unauthorized = 401,
PaymentRequired = 402,

/// 402 Payment Required
/// 403 Forbidden
///
/// The client does not have access rights to the content; that is, it is
/// unauthorized, so the server is refusing to give the requested
/// resource. Unlike 401, the client's identity is known to the server.
PaymentRequired = 402,

/// 403 Forbidden
///
/// The server can not find requested resource. In the browser, this means
/// the URL is not recognized. In an API, this can also mean that the
/// endpoint is valid but the resource itself does not exist. Servers
/// may also send this response instead of 403 to hide the existence of
/// a resource from an unauthorized client. This response code is probably
/// the most famous one due to its frequent occurrence on the web.
Forbidden = 403,

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

0 comments on commit 419817d

Please sign in to comment.