4#include <system/async_callback.h>
5#include <system/collections/list.h>
6#include <system/iasyncresult.h>
7#include <system/io/stream.h>
8#include <system/string.h>
10#include <net/cache/request_cache_policy.h>
11#include <net/iweb_proxy.h>
12#include <net/iweb_request_create.h>
13#include <net/web_header_collection.h>
15namespace System {
namespace Net {
namespace {
16class RequestCachePolicy;
19namespace System {
namespace Net {
227 static bool s_DefaultWebProxyInitialized;
List forward declaration.
Definition: list.h:127
Provides the methods for creating the WebRequest class instances. Objects of this class should only b...
Definition: iweb_request_create.h:17
Creates the WebRequest-class instances. Objects of this class should only be allocated using System::...
Definition: web_request.h:56
System::SharedPtr< WebRequest > Create(System::SharedPtr< Uri > Uri)
Creates a new instance of the WebRequest-class using the specified URI.
Represents an HTTP or HTTPS prefix. Objects of this class should only be allocated using System::Make...
Definition: web_request.h:38
String Prefix
The prefix.
Definition: web_request.h:41
WebRequestPrefixElement(String P, System::SharedPtr< IWebRequestCreate > C)
Constructs a new instance.
System::SharedPtr< IWebRequestCreate > Creator
Creates a new instances of the WebRequest class.
Definition: web_request.h:43
Represents a web request. Objects of this class should only be allocated using System::MakeObject() f...
Definition: web_request.h:31
virtual System::SharedPtr< WebResponse > EndGetResponse(System::SharedPtr< IAsyncResult > asyncResult)=0
Waits until the specified asynchronous request for the resource completes.
virtual void set_ConnectionGroupName(System::String value)
Sets the name of the connection group.
static System::SharedPtr< HttpWebRequest > CreateHttp(System::SharedPtr< Uri > requestUri)
Creates a new instance of the WebRequest class using the specified URI.
virtual System::SharedPtr< WebResponse > GetResponse()
Returns the web response associated with the current web request.
virtual void set_Proxy(System::SharedPtr< IWebProxy > value)
Sets the HTTP proxy.
static System::SharedPtr< WebRequest > CreateDefault(System::SharedPtr< Uri > requestUri)
Creates a WebRequest descendant for the specified URI scheme.
virtual void set_CachePolicy(System::SharedPtr< System::Net::Cache::RequestCachePolicy > value)
Sets the cache policy.
virtual int32_t get_Timeout()
Gets an amount of time in milliseconds after which the request will be timed out.
virtual System::SharedPtr< IWebProxy > get_Proxy()
Gets the HTTP proxy.
virtual String get_Method()=0
Gets the HTTP method.
virtual void set_Headers(System::SharedPtr< WebHeaderCollection > value)=0
Sets the collection of the HTTP headers.
virtual System::SharedPtr< IAsyncResult > BeginGetRequestStream(AsyncCallback callback, System::SharedPtr< Object > state)=0
Initiates an asynchronous operation to get a stream for writing data to the resource.
static System::SharedPtr< WebRequest > Create(String requestUriString)
Creates a new instance of the WebRequest class using the specified URI.
WebRequest()
Constructs a new instance.
virtual void set_ContentLength(int64_t value)
Sets the number of bytes of the request data to sent.
virtual System::SharedPtr< System::IO::Stream > GetRequestStream()
Returns the stream for writing data to the resource.
virtual bool get_UseDefaultCredentials()
Gets a value that indicates if the 'Credential' property is equal to the 'DefaultCredentials' propert...
virtual System::SharedPtr< ICredentials > get_Credentials()
Gets authentication information that is associated with the current request.
virtual void set_PreAuthenticate(bool value)
Sets a value that indicates if the request must be pre-authenticated.
virtual int64_t get_ContentLength()
Gets the number of bytes of the request data to sent.
virtual System::SharedPtr< IO::Stream > EndGetRequestStream(System::SharedPtr< IAsyncResult > asyncResult)=0
Waits until the specified asynchronous operation to get a stream completes.
virtual System::SharedPtr< IAsyncResult > BeginGetResponse(AsyncCallback callback, System::SharedPtr< Object > state)=0
Initiates an asynchronous request for the resource.
virtual String get_ContentType()=0
Gets the MIME type of the request.
virtual System::String get_ConnectionGroupName()
Gets the name of the connection group.
static System::SharedPtr< IWebProxy > get_DefaultWebProxy()
Gets the global HTTP proxy.
virtual void Abort()=0
Aborts the current request.
virtual System::SharedPtr< System::Net::Cache::RequestCachePolicy > get_CachePolicy()
Gets the cache policy.
virtual System::SharedPtr< WebHeaderCollection > get_Headers()=0
Gets the collection of the HTTP headers.
static System::SharedPtr< WebRequest > Create(System::SharedPtr< Uri > requestUri)
Creates a new instance of the WebRequest class using the specified URI.
virtual void set_ContentType(String value)=0
Sets the MIME type of the request.
static System::SharedPtr< Collections::Generic::List< System::SharedPtr< WebRequest::WebRequestPrefixElement > > > get_PrefixList()
Gets the prefix list.
virtual bool get_PreAuthenticate()
Gets a value that indicates if the request must be pre-authenticated.
virtual void set_Timeout(int32_t timeout)
Sets an amount of time in milliseconds after which the request will be timed out.
virtual void set_Credentials(System::SharedPtr< ICredentials > value)
Sets authentication information that is associated with the current request.
virtual void set_UseDefaultCredentials(bool value)
Sets a value that indicates if the 'Credential' property is equal to the 'DefaultCredentials' propert...
virtual void set_Method(String value)=0
Sets the HTTP method.
static System::SharedPtr< HttpWebRequest > CreateHttp(String requestUriString)
Creates a new instance of the WebRequest class using the specified URI.
static void set_DefaultWebProxy(System::SharedPtr< IWebProxy > value)
Sets the global HTTP proxy.
static void set_PrefixList(System::SharedPtr< Collections::Generic::List< System::SharedPtr< WebRequest::WebRequestPrefixElement > > > value)
Sets the prefix list.
virtual System::SharedPtr< Uri > get_RequestUri()=0
Returns the request URI.
static bool RegisterPrefix(String prefix, System::SharedPtr< IWebRequestCreate > creator)
Registers the WebRequest descendant for the specified URI.
Base class that enables using methods available for System.Object class in C#. All non-trivial classe...
Definition: object.h:62
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
Unified resource identifier. Objects of this class should only be allocated using System::MakeObject(...
Definition: uri.h:66
@ WebRequest
A collection contains the headers of web requests.
@ WebResponse
A collection contains the headers of web response.
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