NCBI C++ ToolKit
request_status.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CORELIB___REQUEST_STATUS__HPP
2 #define CORELIB___REQUEST_STATUS__HPP
3 
4 /* $Id: request_status.hpp 101081 2023-10-26 18:49:55Z sadyrovr $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Aleksey Grichenko, Denis Vakatov
30  *
31  * File Description:
32  * HTTP status codes.
33  *
34  */
35 
36 /// @file request_status.hpp
37 ///
38 /// Defines CRequestStatus class for NCBI C++ diagnostic API.
39 ///
40 
41 
42 #include <corelib/ncbistl.hpp>
43 
44 
45 /** @addtogroup Diagnostics
46  *
47  * @{
48  */
49 
50 
52 
53 
55 {
56 public:
57  enum ECode {
58  e100_Continue = 100,
59  e101_SwitchingProtocols = 101,
60 
61  e200_Ok = 200,
62  e201_Created = 201,
63  e202_Accepted = 202,
64  e203_NonAuthInformation = 203,
65  e204_NoContent = 204,
66  e205_ResetContent = 205,
67  e206_PartialContent = 206,
68 
69  /// Non-standard status code - used to indicate broken connection
70  /// while serving partial-content request.
71  e299_PartialContentBrokenConnection = 299,
72 
73  e300_MultipleChoices = 300,
74  e301_MovedPermanently = 301,
75  e302_Found = 302,
76  e303_SeeOther = 303,
77  e304_NotModified = 304,
78  e305_UseProxy = 305,
79  e307_TemporaryRedirect = 307,
80 
81  e400_BadRequest = 400,
82  e401_Unauthorized = 401,
83  e402_PaymentRequired = 402,
84  e403_Forbidden = 403,
85  e404_NotFound = 404,
86  e405_MethodNotAllowed = 405,
87  e406_NotAcceptable = 406,
88  e407_ProxyAuthRequired = 407,
89  e408_RequestTimeout = 408,
90  e409_Conflict = 409,
91  e410_Gone = 410,
92  e411_LengthRequired = 411,
93  e412_PreconditionFailed = 412,
94  e413_RequestEntityTooLarge = 413,
95  e414_RequestURITooLong = 414,
96  e415_UnsupportedMediaType = 415,
97  e416_RangeNotSatisfiable = 416,
98  e417_ExpectationFailed = 417,
99  e422_UnprocessableEntity = 422,
100  e451_Unavailable_For_Legal_Reasons = 451,
101 
102  /// Non-standard status code - used to indicate broken connection
103  /// while serving normal request.
104  e499_BrokenConnection = 499,
105 
106  e500_InternalServerError = 500,
107  e501_NotImplemented = 501,
108  e502_BadGateway = 502,
109  e503_ServiceUnavailable = 503,
110  e504_GatewayTimeout = 504,
111  e505_HTTPVerNotSupported = 505
112  };
113 
114  static string GetStdStatusMessage(ECode code);
115 };
116 
117 
119 
120 
121 #endif /* CORELIB___REQUEST_STATUS__HPP */
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_XNCBI_EXPORT
Definition: ncbi_export.h:1283
The NCBI C++/STL use hints.
Definition: inftrees.h:24
Modified on Thu May 23 12:29:13 2024 by modify_doxy.py rev. 669887