2 * Copyright (C) 2011-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
39 SwitchingProtocols
= 101,
41 ConnectionTimedOut
= 103,
47 NonAuthoritativeInformation
= 203,
54 MultipleChoices
= 300,
55 MovedPermanently
= 301,
61 TemporaryRedirect
= 307,
66 PaymentRequired
= 402,
69 MethodNotAllowed
= 405,
71 ProxyAuthenticationRequired
= 407,
76 PreconditionFailed
= 412,
77 RequestEntityTooLarge
= 413,
78 RequestURITooLong
= 414,
79 UnsupportedMediaType
= 415,
80 RequestedRangeNotSatisfiable
= 416,
81 ExpectationFailed
= 417,
83 TooManyConnections
= 421,
84 UnprocessableEntity
= 422,
86 FailedDependency
= 424,
87 UnorderedCollection
= 425,
88 UpgradeRequired
= 426,
91 InternalServerError
= 500,
94 ServiceUnavailable
= 503,
96 HTTPVersionNotSupported
= 505,
97 VariantAlsoNegotiates
= 506,
98 InsufficientStorage
= 507,
99 BandwidthLimitExceeded
= 509,
107 CHttpResponse(HTTP::Method method
, HTTP::StatusCode status
, HTTP::Version version
= HTTP::Version1_1
);
109 void AddHeader(const std::string
&field
, const std::string
&value
);
110 void SetContent(const char* data
, unsigned int length
);
112 std::string
Create();
115 HTTP::Method m_method
;
116 HTTP::StatusCode m_status
;
117 HTTP::Version m_version
;
118 std::vector
< std::pair
<std::string
, std::string
> > m_headers
;
119 const char* m_content
;
120 unsigned int m_contentLength
;
121 std::string m_buffer
;
123 static std::map
<HTTP::StatusCode
, std::string
> m_statusCodeText
;
124 static std::map
<HTTP::StatusCode
, std::string
> createStatusCodes();