Files
pip/libs/main/http_common/pihttpconstants.h
2026-03-07 17:00:45 +03:00

353 lines
26 KiB
C++
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*! \file pihttpconstants.h
* \ingroup HTTP
* \~\brief
* \~english Shared HTTP methods, status codes and header name constants
* \~russian Общие HTTP-методы, коды статуса и константы имен заголовков
*/
#ifndef pihttpconstants_h
#define pihttpconstants_h
//! \~english Namespace with shared HTTP constants and vocabulary.
//! \~russian Пространство имен с общими HTTP-константами и базовой терминологией.
namespace PIHTTP {
//! \~english HTTP request method.
//! \~russian HTTP-метод запроса.
enum class Method {
Unknown /** \~english Unknown or not set method \~russian Неизвестный или не заданный метод */,
Get /** \~english GET method \~russian Метод GET */,
Head /** \~english HEAD method \~russian Метод HEAD */,
Post /** \~english POST method \~russian Метод POST */,
Put /** \~english PUT method \~russian Метод PUT */,
Delete /** \~english DELETE method \~russian Метод DELETE */,
Connect /** \~english CONNECT method \~russian Метод CONNECT */,
Options /** \~english OPTIONS method \~russian Метод OPTIONS */,
Trace /** \~english TRACE method \~russian Метод TRACE */,
Patch /** \~english PATCH method \~russian Метод PATCH */,
};
//! \~english HTTP status code.
//! \~russian HTTP-код статуса.
enum class Code {
Unknown /** \~english Unknown or unset status code \~russian Неизвестный или не заданный код статуса */ = -1,
Continue /** \~english 100 Continue \~russian 100 Continue */ = 100,
SwitchingProtocols /** \~english 101 Switching Protocols \~russian 101 Switching Protocols */ = 101,
Processing /** \~english 102 Processing \~russian 102 Processing */ = 102,
EarlyHints /** \~english 103 Early Hints \~russian 103 Early Hints */ = 103,
Ok /** \~english 200 OK \~russian 200 OK */ = 200,
Created /** \~english 201 Created \~russian 201 Created */ = 201,
Accepted /** \~english 202 Accepted \~russian 202 Accepted */ = 202,
NonAuthoritativeInformation /** \~english 203 Non-Authoritative Information \~russian 203 Non-Authoritative Information */ = 203,
NoContent /** \~english 204 No Content \~russian 204 No Content */ = 204,
ResetContent /** \~english 205 Reset Content \~russian 205 Reset Content */ = 205,
PartialContent /** \~english 206 Partial Content \~russian 206 Partial Content */ = 206,
MultiStatus /** \~english 207 Multi-Status \~russian 207 Multi-Status */ = 207,
AlreadyReported /** \~english 208 Already Reported \~russian 208 Already Reported */ = 208,
IMUsed /** \~english 226 IM Used \~russian 226 IM Used */ = 226,
MultipleChoices /** \~english 300 Multiple Choices \~russian 300 Multiple Choices */ = 300,
MovedPermanently /** \~english 301 Moved Permanently \~russian 301 Moved Permanently */ = 301,
Found /** \~english 302 Found \~russian 302 Found */ = 302,
SeeOther /** \~english 303 See Other \~russian 303 See Other */ = 303,
NotModified /** \~english 304 Not Modified \~russian 304 Not Modified */ = 304,
UseProxy /** \~english 305 Use Proxy \~russian 305 Use Proxy */ = 305,
SwitchProxy /** \~english 306 Switch Proxy \~russian 306 Switch Proxy */ = 306,
TemporaryRedirect /** \~english 307 Temporary Redirect \~russian 307 Temporary Redirect */ = 307,
PermanentRedirect /** \~english 308 Permanent Redirect \~russian 308 Permanent Redirect */ = 308,
BadRequest /** \~english 400 Bad Request \~russian 400 Bad Request */ = 400,
Unauthorized /** \~english 401 Unauthorized \~russian 401 Unauthorized */ = 401,
PaymentRequired /** \~english 402 Payment Required \~russian 402 Payment Required */ = 402,
Forbidden /** \~english 403 Forbidden \~russian 403 Forbidden */ = 403,
NotFound /** \~english 404 Not Found \~russian 404 Not Found */ = 404,
MethodNotAllowed /** \~english 405 Method Not Allowed \~russian 405 Method Not Allowed */ = 405,
NotAcceptable /** \~english 406 Not Acceptable \~russian 406 Not Acceptable */ = 406,
ProxyAuthenticationRequired /** \~english 407 Proxy Authentication Required \~russian 407 Proxy Authentication Required */ = 407,
RequestTimeout /** \~english 408 Request Timeout \~russian 408 Request Timeout */ = 408,
Conflict /** \~english 409 Conflict \~russian 409 Conflict */ = 409,
Gone /** \~english 410 Gone \~russian 410 Gone */ = 410,
LengthRequired /** \~english 411 Length Required \~russian 411 Length Required */ = 411,
PreconditionFailed /** \~english 412 Precondition Failed \~russian 412 Precondition Failed */ = 412,
ContentTooLarge /** \~english 413 Content Too Large \~russian 413 Content Too Large */ = 413,
UriTooLong /** \~english 414 URI Too Long \~russian 414 URI Too Long */ = 414,
UnsupportedMediaType /** \~english 415 Unsupported Media Type \~russian 415 Unsupported Media Type */ = 415,
RangeNotSatisfiable /** \~english 416 Range Not Satisfiable \~russian 416 Range Not Satisfiable */ = 416,
ExpectationFailed /** \~english 417 Expectation Failed \~russian 417 Expectation Failed */ = 417,
MisdirectedRequest /** \~english 421 Misdirected Request \~russian 421 Misdirected Request */ = 421,
UnprocessableContent /** \~english 422 Unprocessable Content \~russian 422 Unprocessable Content */ = 422,
Locked /** \~english 423 Locked \~russian 423 Locked */ = 423,
FailedDependency /** \~english 424 Failed Dependency \~russian 424 Failed Dependency */ = 424,
TooEarly /** \~english 425 Too Early \~russian 425 Too Early */ = 425,
UpgradeRequired /** \~english 426 Upgrade Required \~russian 426 Upgrade Required */ = 426,
PreconditionRequired /** \~english 428 Precondition Required \~russian 428 Precondition Required */ = 428,
TooManyRequests /** \~english 429 Too Many Requests \~russian 429 Too Many Requests */ = 429,
RequestHeaderFieldsTooLarge /** \~english 431 Request Header Fields Too Large \~russian 431 Request Header Fields Too Large */ = 431,
RetryWith /** \~english 449 Retry With \~russian 449 Retry With */ = 449,
BlockedByWindowsParentalControls /** \~english 450 Blocked by Windows Parental Controls \~russian 450 Blocked by Windows Parental Controls */ = 450,
UnavailableForLegalReasons /** \~english 451 Unavailable For Legal Reasons \~russian 451 Unavailable For Legal Reasons */ = 451,
InternalServerError /** \~english 500 Internal Server Error \~russian 500 Internal Server Error */ = 500,
NotImplemented /** \~english 501 Not Implemented \~russian 501 Not Implemented */ = 501,
BadGateway /** \~english 502 Bad Gateway \~russian 502 Bad Gateway */ = 502,
ServiceUnavailable /** \~english 503 Service Unavailable \~russian 503 Service Unavailable */ = 503,
GatewayTimeout /** \~english 504 Gateway Timeout \~russian 504 Gateway Timeout */ = 504,
HttpVersionNotSupported /** \~english 505 HTTP Version Not Supported \~russian 505 HTTP Version Not Supported */ = 505,
VariantAlsoNegotiates /** \~english 506 Variant Also Negotiates \~russian 506 Variant Also Negotiates */ = 506,
InsufficientStorage /** \~english 507 Insufficient Storage \~russian 507 Insufficient Storage */ = 507,
LoopDetected /** \~english 508 Loop Detected \~russian 508 Loop Detected */ = 508,
NotExtended /** \~english 510 Not Extended \~russian 510 Not Extended */ = 510,
BandwidthLimitExceeded /** \~english 509 Bandwidth Limit Exceeded \~russian 509 Bandwidth Limit Exceeded */ = 509,
NetworkAuthenticationRequired /** \~english 511 Network Authentication Required \~russian 511 Network Authentication Required */ = 511,
};
//! \~english Namespace with shared HTTP header field name literals.
//! \~russian Пространство имен с общими строковыми литералами имен HTTP-заголовков.
//!
//! \~english Constant names follow the header field names used on the wire.
//! \~russian Имена констант повторяют имена полей заголовков, используемые в протоколе.
namespace Header {
//! \~english Common request and response header fields.
//! \~russian Общие поля заголовков запросов и ответов.
constexpr static char Accept[] = "Accept";
constexpr static char AcceptCharset[] = "Accept-Charset";
constexpr static char AcceptEncoding[] = "Accept-Encoding";
constexpr static char AcceptLanguage[] = "Accept-Language";
constexpr static char AcceptRanges[] = "Accept-Ranges";
constexpr static char Age[] = "Age";
constexpr static char Allow[] = "Allow";
constexpr static char AuthenticationInfo[] = "Authentication-Info";
constexpr static char Authorization[] = "Authorization";
constexpr static char CacheControl[] = "Cache-Control";
constexpr static char Close[] = "Close";
constexpr static char Connection[] = "Connection";
constexpr static char ContentEncoding[] = "Content-Encoding";
constexpr static char ContentLanguage[] = "Content-Language";
constexpr static char ContentLength[] = "Content-Length";
constexpr static char ContentLocation[] = "Content-Location";
constexpr static char ContentRange[] = "Content-Range";
constexpr static char ContentType[] = "Content-Type";
constexpr static char Date[] = "Date";
constexpr static char ETag[] = "ETag";
constexpr static char Expect[] = "Expect";
constexpr static char Expires[] = "Expires";
constexpr static char From[] = "From";
constexpr static char Host[] = "Host";
constexpr static char IfMatch[] = "If-Match";
constexpr static char IfModifiedSince[] = "If-Modified-Since";
constexpr static char IfNoneMatch[] = "If-None-Match";
constexpr static char IfRange[] = "If-Range";
constexpr static char IfUnmodifiedSince[] = "If-Unmodified-Since";
constexpr static char LastModified[] = "Last-Modified";
constexpr static char Location[] = "Location";
constexpr static char MaxForwards[] = "Max-Forwards";
constexpr static char MimeVersion[] = "MIME-Version";
constexpr static char Pragma[] = "Pragma";
constexpr static char ProxyAuthenticate[] = "Proxy-Authenticate";
constexpr static char ProxyAuthenticationInfo[] = "Proxy-Authentication-Info";
constexpr static char ProxyAuthorization[] = "Proxy-Authorization";
constexpr static char Range[] = "Range";
constexpr static char Referer[] = "Referer";
constexpr static char RetryAfter[] = "Retry-After";
constexpr static char Server[] = "Server";
constexpr static char TE[] = "TE";
constexpr static char Trailer[] = "Trailer";
constexpr static char TransferEncoding[] = "Transfer-Encoding";
constexpr static char Upgrade[] = "Upgrade";
constexpr static char UserAgent[] = "User-Agent";
constexpr static char Vary[] = "Vary";
constexpr static char Via[] = "Via";
constexpr static char WWWAuthenticate[] = "WWW-Authenticate";
//! \~english Special wildcard token used by some HTTP fields.
//! \~russian Специальный подстановочный токен, используемый некоторыми HTTP-полями.
constexpr static char Asterisk[] = "*";
//! \~english Extended, CORS, security and protocol-specific header fields.
//! \~russian Расширенные, CORS-, security- и protocol-specific поля заголовков.
constexpr static char AIM[] = "A-IM";
constexpr static char AcceptAdditions[] = "Accept-Additions";
constexpr static char AcceptCH[] = "Accept-CH";
constexpr static char AcceptDatetime[] = "Accept-Datetime";
constexpr static char AcceptFeatures[] = "Accept-Features";
constexpr static char AcceptPatch[] = "Accept-Patch";
constexpr static char AcceptPost[] = "Accept-Post";
constexpr static char AcceptSignature[] = "Accept-Signature";
constexpr static char AccessControlAllowCredentials[] = "Access-Control-Allow-Credentials";
constexpr static char AccessControlAllowHeaders[] = "Access-Control-Allow-Headers";
constexpr static char AccessControlAllowMethods[] = "Access-Control-Allow-Methods";
constexpr static char AccessControlAllowOrigin[] = "Access-Control-Allow-Origin";
constexpr static char AccessControlExposeHeaders[] = "Access-Control-Expose-Headers";
constexpr static char AccessControlMaxAge[] = "Access-Control-Max-Age";
constexpr static char AccessControlRequestHeaders[] = "Access-Control-Request-Headers";
constexpr static char AccessControlRequestMethod[] = "Access-Control-Request-Method";
constexpr static char ALPN[] = "ALPN";
constexpr static char AltSvc[] = "Alt-Svc";
constexpr static char AltUsed[] = "Alt-Used";
constexpr static char Alternates[] = "Alternates";
constexpr static char ApplyToRedirectRef[] = "Apply-To-Redirect-Ref";
constexpr static char AuthenticationControl[] = "Authentication-Control";
constexpr static char CacheStatus[] = "Cache-Status";
constexpr static char CalManagedID[] = "Cal-Managed-ID";
constexpr static char CalDAVTimezones[] = "CalDAV-Timezones";
constexpr static char CapsuleProtocol[] = "Capsule-Protocol";
constexpr static char CDNCacheControl[] = "CDN-Cache-Control";
constexpr static char CDNLoop[] = "CDN-Loop";
constexpr static char CertNotAfter[] = "Cert-Not-After";
constexpr static char CertNotBefore[] = "Cert-Not-Before";
constexpr static char ClearSiteData[] = "Clear-Site-Data";
constexpr static char ClientCert[] = "Client-Cert";
constexpr static char ClientCertChain[] = "Client-Cert-Chain";
constexpr static char ContentDigest[] = "Content-Digest";
constexpr static char ContentDisposition[] = "Content-Disposition";
constexpr static char ContentID[] = "Content-ID";
constexpr static char ContentSecurityPolicy[] = "Content-Security-Policy";
constexpr static char ContentSecurityPolicyReportOnly[] = "Content-Security-Policy-Report-Only";
constexpr static char Cookie[] = "Cookie";
constexpr static char CrossOriginEmbedderPolicy[] = "Cross-Origin-Embedder-Policy";
constexpr static char CrossOriginEmbedderPolicyReportOnly[] = "Cross-Origin-Embedder-Policy-Report-Only";
constexpr static char CrossOriginOpenerPolicy[] = "Cross-Origin-Opener-Policy";
constexpr static char CrossOriginOpenerPolicyReportOnly[] = "Cross-Origin-Opener-Policy-Report-Only";
constexpr static char CrossOriginResourcePolicy[] = "Cross-Origin-Resource-Policy";
constexpr static char DASL[] = "DASL";
constexpr static char DAV[] = "DAV";
constexpr static char DeltaBase[] = "Delta-Base";
constexpr static char Depth[] = "Depth";
constexpr static char Destination[] = "Destination";
constexpr static char DifferentialID[] = "Differential-ID";
constexpr static char DPoP[] = "DPoP";
constexpr static char DPoPNonce[] = "DPoP-Nonce";
constexpr static char EarlyData[] = "Early-Data";
constexpr static char ExpectCT[] = "Expect-CT";
constexpr static char Forwarded[] = "Forwarded";
constexpr static char Hobareg[] = "Hobareg";
constexpr static char If[] = "If";
constexpr static char IfScheduleTagMatch[] = "If-Schedule-Tag-Match";
constexpr static char IM[] = "IM";
constexpr static char IncludeReferredTokenBindingID[] = "Include-Referred-Token-Binding-ID";
constexpr static char KeepAlive[] = "Keep-Alive";
constexpr static char Label[] = "Label";
constexpr static char LastEventID[] = "Last-Event-ID";
constexpr static char Link[] = "Link";
constexpr static char LockToken[] = "Lock-Token";
constexpr static char MementoDatetime[] = "Memento-Datetime";
constexpr static char Meter[] = "Meter";
constexpr static char Negotiate[] = "Negotiate";
constexpr static char NEL[] = "NEL";
constexpr static char ODataEntityid[] = "OData-EntityId";
constexpr static char ODataIsolation[] = "OData-Isolation";
constexpr static char ODataMaxversion[] = "OData-MaxVersion";
constexpr static char ODataVersion[] = "OData-Version";
constexpr static char OptionalWWWAuthenticate[] = "Optional-WWW-Authenticate";
constexpr static char OrderingType[] = "Ordering-Type";
constexpr static char Origin[] = "Origin";
constexpr static char OriginAgentCluster[] = "Origin-Agent-Cluster";
constexpr static char OSCORE[] = "OSCORE";
constexpr static char OSLCCoreVersion[] = "OSLC-Core-Version";
constexpr static char Overwrite[] = "Overwrite";
constexpr static char PingFrom[] = "Ping-From";
constexpr static char PingTo[] = "Ping-To";
constexpr static char Position[] = "Position";
constexpr static char Prefer[] = "Prefer";
constexpr static char PreferenceApplied[] = "Preference-Applied";
constexpr static char Priority[] = "Priority";
constexpr static char ProxyStatus[] = "Proxy-Status";
constexpr static char PublicKeyPins[] = "Public-Key-Pins";
constexpr static char PublicKeyPinsReportOnly[] = "Public-Key-Pins-Report-Only";
constexpr static char RedirectRef[] = "Redirect-Ref";
constexpr static char Refresh[] = "Refresh";
constexpr static char ReplayNonce[] = "Replay-Nonce";
constexpr static char ReprDigest[] = "Repr-Digest";
constexpr static char ScheduleReply[] = "Schedule-Reply";
constexpr static char ScheduleTag[] = "Schedule-Tag";
constexpr static char SecPurpose[] = "Sec-Purpose";
constexpr static char SecTokenBinding[] = "Sec-Token-Binding";
constexpr static char SecWebsocketAccept[] = "Sec-WebSocket-Accept";
constexpr static char SecWebsocketExtensions[] = "Sec-WebSocket-Extensions";
constexpr static char SecWebsocketKey[] = "Sec-WebSocket-Key";
constexpr static char SecWebsocketProtocol[] = "Sec-WebSocket-Protocol";
constexpr static char SecWebsocketVersion[] = "Sec-WebSocket-Version";
constexpr static char ServerTiming[] = "Server-Timing";
constexpr static char SetCookie[] = "Set-Cookie";
constexpr static char Signature[] = "Signature";
constexpr static char SignatureInput[] = "Signature-Input";
constexpr static char SLUG[] = "SLUG";
constexpr static char Soapaction[] = "SoapAction";
constexpr static char StatusURI[] = "Status-URI";
constexpr static char StrictTransportSecurity[] = "Strict-Transport-Security";
constexpr static char Sunset[] = "Sunset";
constexpr static char SurrogateCapability[] = "Surrogate-Capability";
constexpr static char SurrogateControl[] = "Surrogate-Control";
constexpr static char TCN[] = "TCN";
constexpr static char Timeout[] = "Timeout";
constexpr static char Topic[] = "Topic";
constexpr static char Traceparent[] = "Traceparent";
constexpr static char Tracestate[] = "Tracestate";
constexpr static char TTL[] = "TTL";
constexpr static char Urgency[] = "Urgency";
constexpr static char VariantVary[] = "Variant-Vary";
constexpr static char WantContentDigest[] = "Want-Content-Digest";
constexpr static char WantReprDigest[] = "Want-Repr-Digest";
constexpr static char XContentTypeOptions[] = "X-Content-Type-Options";
constexpr static char XFrameOptions[] = "X-Frame-Options";
constexpr static char AmpCacheTransform[] = "AMP-Cache-Transform";
constexpr static char ConfigurationContext[] = "Configuration-Context";
constexpr static char EDIINTFeatures[] = "EDIINT-Features";
constexpr static char Isolation[] = "Isolation";
constexpr static char PermissionsPolicy[] = "Permissions-Policy";
constexpr static char RepeatabilityClientID[] = "Repeatability-Client-ID";
constexpr static char RepeatabilityFirstSent[] = "Repeatability-First-Sent";
constexpr static char RepeatabilityRequestID[] = "Repeatability-Request-ID";
constexpr static char RepeatabilityResult[] = "Repeatability-Result";
constexpr static char ReportingEndpoints[] = "Reporting-Endpoints";
constexpr static char SecGPC[] = "Sec-GPC";
constexpr static char TimingAllowOrigin[] = "Timing-Allow-Origin";
constexpr static char CPEPInfo[] = "C-PEP-Info";
constexpr static char ProtocolInfo[] = "Protocol-Info";
constexpr static char ProtocolQuery[] = "Protocol-Query";
constexpr static char AccessControl[] = "Access-Control";
constexpr static char CExt[] = "C-Ext";
constexpr static char CMan[] = "C-Man";
constexpr static char COpt[] = "C-Opt";
constexpr static char CPEP[] = "C-PEP";
constexpr static char ContentBase[] = "Content-Base";
constexpr static char ContentMD5[] = "Content-MD5";
constexpr static char ContentScriptType[] = "Content-Script-Type";
constexpr static char ContentStyleType[] = "Content-Style-Type";
constexpr static char ContentVersion[] = "Content-Version";
constexpr static char Cookie2[] = "Cookie2";
constexpr static char DefaultStyle[] = "Default-Style";
constexpr static char DerivedFrom[] = "Derived-From";
constexpr static char Digest[] = "Digest";
constexpr static char Ext[] = "Ext";
constexpr static char Getprofile[] = "GetProfile";
constexpr static char HTTP2Settings[] = "HTTP2-Settings";
constexpr static char Man[] = "Man";
constexpr static char MethodCheck[] = "Method-Check";
constexpr static char MethodCheckExpires[] = "Method-Check-Expires";
constexpr static char Opt[] = "Opt";
constexpr static char P3P[] = "P3P";
constexpr static char PEP[] = "PEP";
constexpr static char PepInfo[] = "Pep-Info";
constexpr static char PICSLabel[] = "PICS-Label";
constexpr static char Profileobject[] = "ProfileObject";
constexpr static char Protocol[] = "Protocol";
constexpr static char ProtocolRequest[] = "Protocol-Request";
constexpr static char ProxyFeatures[] = "Proxy-Features";
constexpr static char ProxyInstruction[] = "Proxy-Instruction";
constexpr static char Public[] = "Public";
constexpr static char RefererRoot[] = "Referer-Root";
constexpr static char Safe[] = "Safe";
constexpr static char SecurityScheme[] = "Security-Scheme";
constexpr static char SetCookie2[] = "Set-Cookie2";
constexpr static char Setprofile[] = "SetProfile";
constexpr static char URI[] = "URI";
constexpr static char WantDigest[] = "Want-Digest";
constexpr static char Warning[] = "Warning";
}; // namespace Header
}; // namespace PIHTTP
#endif