CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
http_response_message.h
1
2#pragma once
3
4#include <system/idisposable.h>
5#include <system/shared_ptr.h>
6#include <system/string.h>
7
8#include <net/http/headers/http_response_headers.h>
9#include <net/http/http_request_message.h>
10#include <net/http_status_code.h>
11
12namespace System { namespace Net { namespace Http {
13
18class ASPOSECPP_SHARED_CLASS HttpResponseMessage : public System::IDisposable
19{
24
26 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
28 ASPOSECPP_SHARED_RTTI_INFO_DECL();
29
30public:
33 ASPOSECPP_SHARED_API System::Version get_Version() const;
36 ASPOSECPP_SHARED_API void set_Version(System::Version value);
39 ASPOSECPP_SHARED_API System::SharedPtr<HttpContent> get_Content() const;
42 ASPOSECPP_SHARED_API void set_Content(System::SharedPtr<HttpContent> value);
45 ASPOSECPP_SHARED_API HttpStatusCode get_StatusCode() const;
48 ASPOSECPP_SHARED_API void set_StatusCode(HttpStatusCode value);
51 ASPOSECPP_SHARED_API String get_ReasonPhrase() const;
54 ASPOSECPP_SHARED_API void set_ReasonPhrase(String value);
67 ASPOSECPP_SHARED_API bool get_IsSuccessStatusCode() const;
68
70 ASPOSECPP_SHARED_API HttpResponseMessage();
73 ASPOSECPP_SHARED_API HttpResponseMessage(HttpStatusCode statusCode);
74
80 ASPOSECPP_SHARED_API String ToString() const override;
82 ASPOSECPP_SHARED_API void Dispose() override;
83
84protected:
87 virtual void Dispose(bool disposing);
88#ifdef ASPOSE_GET_SHARED_MEMBERS
90 void GetSharedMembers(System::Object::shared_members_type& result) const override;
91#endif
92
93private:
95 static const HttpStatusCode defaultStatusCode;
97 HttpStatusCode _statusCode;
101 String _reasonPhrase;
105 System::Version _version;
109 bool _disposed;
110
114 bool ContainsNewLineCharacter(String value);
117 void CheckDisposed();
118};
119
120}}} // namespace System::Net::Http
Defines method that releases resources owned by the current object. Objects of this class should only...
Definition: idisposable.h:30
Represents an HTTP response message. Objects of this class should only be allocated using System::Mak...
Definition: http_response_message.h:19
void Dispose() override
Disposes the current instance. This method also disposes content of the HTTP response.
System::SharedPtr< HttpRequestMessage > get_RequestMessage() const
Gets the HTTP request message.
String get_ReasonPhrase() const
Gets the Reason-Phrase that is sent by servers together with the status code.
bool get_IsSuccessStatusCode() const
Checks if the status code indicates that the action requested by the client was received,...
String ToString() const override
System::Object::ToString.
HttpStatusCode get_StatusCode() const
Gets the HTTP status code.
System::SharedPtr< HttpResponseMessage > EnsureSuccessStatusCode()
Checks the status code. HttpRequestException will be thrown when the status code doesn't belong to 2x...
void set_ReasonPhrase(String value)
Sets the Reason-Phrase that is sent by servers together with the status code.
void set_Content(System::SharedPtr< HttpContent > value)
Sets content of the HTTP response.
void set_RequestMessage(System::SharedPtr< HttpRequestMessage > value)
Sets the HTTP request message.
HttpResponseMessage()
Constructs a new instance.
HttpResponseMessage(HttpStatusCode statusCode)
Constructs a new instance.
void set_StatusCode(HttpStatusCode value)
Sets the HTTP status code.
System::SharedPtr< HttpContent > get_Content() const
Gets content of the HTTP response.
void set_Version(System::Version value)
Sets the HTTP version.
System::Version get_Version() const
Gets the HTTP version.
virtual void Dispose(bool disposing)
Disposes the current instance. This method also disposes content of the HTTP response.
System::SharedPtr< Headers::HttpResponseHeaders > get_Headers() const
Returns the HTTP content headers.
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
String class used across the library. Is a substitute for C# System.String when translating code....
Definition: string.h:122
Represents a version number. This type should be allocated on stack and passed to functions by value ...
Definition: version.h:15
HttpStatusCode
Definition: http_status_code.h:9
Definition: db_command.h:9