CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
http_web_response.h
1
2#pragma once
3
4#include <system/collections/ienumerable.h>
5#include <system/io/stream.h>
6#include <system/object.h>
7#include <system/shared_ptr.h>
8#include <system/uri.h>
9
10#include <net/cookie_collection.h>
11#include <net/cookie_container.h>
12#include <net/http/http_response_message.h>
13#include <net/http_status_code.h>
14#include <net/web_header_collection.h>
15#include <net/web_response.h>
16
17namespace System { namespace Net {
18
23class ASPOSECPP_SHARED_CLASS HttpWebResponse : public System::Net::WebResponse
24{
29
31 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
33 ASPOSECPP_SHARED_RTTI_INFO_DECL();
34
35public:
37 ASPOSECPP_SHARED_API int64_t get_ContentLength() override;
39 ASPOSECPP_SHARED_API String get_ContentType() override;
42 ASPOSECPP_SHARED_API virtual System::SharedPtr<CookieCollection> get_Cookies();
44 ASPOSECPP_SHARED_API System::SharedPtr<WebHeaderCollection> get_Headers() override;
47 ASPOSECPP_SHARED_API virtual String get_Method();
49 ASPOSECPP_SHARED_API System::SharedPtr<Uri> get_ResponseUri() override;
52 ASPOSECPP_SHARED_API virtual HttpStatusCode get_StatusCode();
55 ASPOSECPP_SHARED_API virtual String get_StatusDescription();
57 ASPOSECPP_SHARED_API bool get_SupportsHeaders() override;
61 ASPOSECPP_SHARED_API String GetResponseHeader(String headerName);
62
68 System::SharedPtr<Uri> requestUri,
70
72 ASPOSECPP_SHARED_API System::SharedPtr<IO::Stream> GetResponseStream() override;
74 ASPOSECPP_SHARED_API void Close() override;
75
78 ASPOSECPP_SHARED_API System::String get_CharacterSet()
79 {
80 throw NotImplementedException(ASPOSE_CURRENT_FUNCTION);
81 }
82
83protected:
85 void Dispose(bool disposing) override;
86#ifdef ASPOSE_GET_SHARED_MEMBERS
88 void GetSharedMembers(System::Object::shared_members_type& result) const override;
89#endif
90private:
94 System::SharedPtr<Uri> _requestUri;
98 System::SharedPtr<WebHeaderCollection> _webHeaderCollection;
99
102 void CheckDisposed();
107};
108
109}} // namespace System::Net
Represents the HTTP web response. Objects of this class should only be allocated using System::MakeOb...
Definition: http_web_response.h:24
virtual String get_StatusDescription()
Returns the string representation of the status code.
System::SharedPtr< Uri > get_ResponseUri() override
Returns the resource's URI.
void Dispose(bool disposing) override
Does nothing.
bool get_SupportsHeaders() override
Returns a value that indicates if the current response supports headers.
System::String get_CharacterSet()
Not implemented.
Definition: http_web_response.h:78
virtual String get_Method()
Returns the HTTP method.
int64_t get_ContentLength() override
Returns the number of bytes of the resource.
String GetResponseHeader(String headerName)
Returns the corresponding value for the specified header name.
void Close() override
Closes the response stream.
HttpWebResponse(System::SharedPtr< Http::HttpResponseMessage > _message, System::SharedPtr< Uri > requestUri, System::SharedPtr< CookieContainer > cookieContainer)
Constructs a new instance.
String get_ContentType() override
Returns the MIME type of the resource.
virtual System::SharedPtr< CookieCollection > get_Cookies()
Returns cookies associated with the web response.
System::SharedPtr< WebHeaderCollection > get_Headers() override
Returns the collection of the headers that are associated with the current response.
virtual HttpStatusCode get_StatusCode()
Returns the HTTP status code associated with the web response.
System::SharedPtr< IO::Stream > GetResponseStream() override
Returns the response stream.
Represents a web response. Objects of this class should only be allocated using System::MakeObject() ...
Definition: web_response.h:20
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
HttpStatusCode
Definition: http_status_code.h:9
Definition: db_command.h:9