CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
file_web_request.h
1
2#pragma once
3
4#include <cstdint>
5#include <system/async_callback.h>
6#include <system/object.h>
7#include <system/shared_ptr.h>
8#include <system/string.h>
9#include <system/uri.h>
10#include <net/cookie_container.h>
11#include <net/http/http_response_message.h>
12#include <net/iweb_proxy.h>
13#include <net/service_point.h>
14#include <net/web_request.h>
15#include "security/cryptography/x509_certificates/x509_certificate_collection.h"
16
17namespace System { namespace Net {
18
19class RequestStream;
20
25class ASPOSECPP_SHARED_CLASS FileWebRequest : public System::Net::WebRequest
26{
31
33 typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
35 ASPOSECPP_SHARED_RTTI_INFO_DECL();
36
37public:
39 ASPOSECPP_SHARED_API void set_Timeout(int timeout) override;
40
42 ASPOSECPP_SHARED_API String get_ContentType() override;
44 ASPOSECPP_SHARED_API void set_ContentType(String value) override;
46 ASPOSECPP_SHARED_API System::SharedPtr<WebHeaderCollection> get_Headers() override;
48 ASPOSECPP_SHARED_API void set_Headers(System::SharedPtr<WebHeaderCollection> value) override;
50 ASPOSECPP_SHARED_API String get_Method() override;
52 ASPOSECPP_SHARED_API void set_Method(String value) override;
54 ASPOSECPP_SHARED_API System::SharedPtr<Uri> get_RequestUri() override;
55
58 ASPOSECPP_SHARED_API FileWebRequest(System::SharedPtr<Uri> uri);
60 ASPOSECPP_SHARED_API System::SharedPtr<WebResponse> GetResponse() override;
62 ASPOSECPP_SHARED_API void Abort() override;
65 System::SharedPtr<Object> state) override;
67 ASPOSECPP_SHARED_API System::SharedPtr<IO::Stream>
71 System::SharedPtr<Object> state) override;
73 ASPOSECPP_SHARED_API virtual System::SharedPtr<WebResponse>
75
76protected:
77#ifdef ASPOSE_GET_SHARED_MEMBERS
79 void GetSharedMembers(System::Object::shared_members_type& result) const override;
80#endif
81private:
83 System::SharedPtr<Uri> _requestUri;
85 int32_t _timeout;
86};
87
88}} // namespace System::Net
Provides implementation of the WebRequest abstract class to work with the file system....
Definition: file_web_request.h:26
void set_Headers(System::SharedPtr< WebHeaderCollection > value) override
Sets the collection of the HTTP headers.
void set_ContentType(String value) override
Sets the MIME type of the request.
void Abort() override
Aborts the current request.
System::SharedPtr< Uri > get_RequestUri() override
Returns the request URI.
FileWebRequest(System::SharedPtr< Uri > uri)
Constructs a new instance.
System::SharedPtr< WebHeaderCollection > get_Headers() override
Gets the collection of the HTTP headers.
void set_Timeout(int timeout) override
Sets an amount of time in milliseconds after which the request will be timed out.
virtual System::SharedPtr< WebResponse > EndGetResponse(System::SharedPtr< IAsyncResult > asyncResult) override
Waits until the specified asynchronous request for the resource completes.
System::SharedPtr< WebResponse > GetResponse() override
Returns the web response associated with the current web request.
System::SharedPtr< IAsyncResult > BeginGetResponse(AsyncCallback callback, System::SharedPtr< Object > state) override
Initiates an asynchronous request for the resource.
String get_Method() override
Gets the HTTP method.
String get_ContentType() override
Gets the MIME type of the request.
System::SharedPtr< IAsyncResult > BeginGetRequestStream(AsyncCallback callback, System::SharedPtr< Object > state) override
Initiates an asynchronous operation to get a stream for writing data to the resource.
void set_Method(String value) override
Sets the HTTP method.
System::SharedPtr< IO::Stream > EndGetRequestStream(System::SharedPtr< IAsyncResult > asyncResult) override
Waits until the specified asynchronous operation to get a stream completes.
Represents a web request. Objects of this class should only be allocated using System::MakeObject() f...
Definition: web_request.h:31
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
Definition: db_command.h:9
System::MulticastDelegate< void(SharedPtr< IAsyncResult >)> AsyncCallback
A delegate type that represents a method to be called when asynchronous operation completes.
Definition: async_callback.h:13