HttpWebRequest

HttpWebRequest class

Represents the HTTP web request. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

class HttpWebRequest : public System::Net::WebRequest

Methods

MethodDescription
void Abort() overrideAborts the current request.
virtual void AddRange(int32_t)Adds the ‘Range’ header to the current request.
virtual void AddRange(System::String, int32_t, int32_t)Adds the ‘Range’ header to the current request.
System::SharedPtr<IAsyncResult> BeginGetRequestStream(AsyncCallback, System::SharedPtr<Object>) overrideInitiates an asynchronous operation to get a stream for writing data to the resource.
System::SharedPtr<IAsyncResult> BeginGetResponse(AsyncCallback, System::SharedPtr<Object>) overrideInitiates an asynchronous request for the resource.
static System::SharedPtr<WebRequest> Create(String)Creates a new instance of the WebRequest class using the specified URI.
static System::SharedPtr<WebRequest> Create(System::SharedPtr<Uri>)Creates a new instance of the WebRequest class using the specified URI.
static System::SharedPtr<WebRequest> CreateDefault(System::SharedPtr<Uri>)Creates a WebRequest descendant for the specified URI scheme.
static System::SharedPtr<HttpWebRequest> CreateHttp(String)Creates a new instance of the WebRequest class using the specified URI.
static System::SharedPtr<HttpWebRequest> CreateHttp(System::SharedPtr<Uri>)Creates a new instance of the WebRequest class using the specified URI.
System::SharedPtr<IO::Stream> EndGetRequestStream(System::SharedPtr<IAsyncResult>) overrideWaits until the specified asynchronous operation to get a stream completes.
System::SharedPtr<WebResponse> EndGetResponse(System::SharedPtr<IAsyncResult>) overrideWaits until the specified asynchronous request for the resource completes.
virtual bool Equals(ptr)Compares objects using C# Object.Equals semantics.
static std::enable_if<IsSmartPtr<T1>::value&&IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares reference type objects in C# style.
static std::enable_if<!IsSmartPtr<T1>::value&&!IsSmartPtr<T2>::value, bool>::type Equals(T1 const&, T2 const&)Compares value type objects in C# style.
static bool Equals(float const&, float const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
static bool Equals(double const&, double const&)Emulates C#-style floating point comparison where two NaNs are considered equal even though according to IEC 60559:1989 NaN is not equal to any value, including NaN.
virtual bool FastCast(const Details::FastRttiBase&, void **) constFor internal purposes only.
String get_Accept()Gets the ‘Accept’ HTTP header value.
virtual bool get_AllowAutoRedirect()Gets a value that indicates if the request should follow redirections.
virtual bool get_AllowReadStreamBuffering()Gets a value indicates if the data received from the resource must be buffered.
virtual bool get_AllowWriteStreamBuffering()Gets a value that indicates if buffering is enabled for sending data.
virtual System::SharedPtr<System::Net::Cache::RequestCachePolicy> get_CachePolicy()Gets the cache policy.
virtual System::SharedPtr<System::Security::Cryptography::X509Certificates::X509CertificateCollection> get_ClientCertificates()Gets the collection of the certificates that are associated with the current request.
System::String get_ConnectionGroupName() overrideGets the name of the connection group.
int64_t get_ContentLength() overrideGets the number of bytes of the request data to sent.
String get_ContentType() overrideGets the MIME type of the request.
int32_t get_ContinueTimeout()Gets a timeout to wait until the 100-Continue status code is received.
virtual System::SharedPtr<System::Net::CookieContainer> get_CookieContainer()Gets a cookie container associated with the current web request.
System::SharedPtr<ICredentials> get_Credentials() overrideGets authentication information that is associated with the current request.
static System::SharedPtr<IWebProxy> get_DefaultWebProxy()Gets the global HTTP proxy.
virtual bool get_HaveResponse()Returns a value that indicates if a response is received.
System::SharedPtr<WebHeaderCollection> get_Headers() overrideGets the collection of the HTTP headers.
virtual bool get_KeepAlive()Gets a value that indicates if the current request must contain the ‘Keep-Alive’ header.
virtual int get_MaximumAutomaticRedirections()Gets a maximum number of allowed redirections.
String get_Method() overrideGets the HTTP method.
bool get_PreAuthenticate() overrideGets a value that indicates if the request must be pre-authenticated.
static System::SharedPtr<Collections::Generic::List<System::SharedPtr<WebRequest::WebRequestPrefixElement>>> get_PrefixList()Gets the prefix list.
System::SharedPtr<IWebProxy> get_Proxy() overrideGets the HTTP proxy.
virtual System::String get_Referer()Gets a value of the ‘Referer’ header.
System::SharedPtr<Uri> get_RequestUri() overrideReturns the request URI.
virtual bool get_SendChunked()Gets a value that indicates if data must be sent in segments.
System::SharedPtr<ServicePoint> get_ServicePoint()Returns a service point that represents the network connection to the resource.
virtual bool get_SupportsCookieContainer()Returns a value that indicates if the current request can use a cookie container.
int32_t get_Timeout() overrideGets an amount of time in milliseconds after which the request will be timed out.
bool get_UseDefaultCredentials() overrideGets a value that indicates if the ‘Credential’ property is equal to the ‘DefaultCredentials’ property.
virtual System::String get_UserAgent()Gets a value of the ‘User-Agent’ header.
Detail::SmartPtrCounter * GetCounter()Gets reference counter data structure associated with the object.
virtual int32_t GetHashCode() constAnalog of C# Object.GetHashCode() method. Enables hashing of custom objects.
System::SharedPtr<System::IO::Stream> GetRequestStream() overrideReturns the stream for writing data to the resource.
System::SharedPtr<WebResponse> GetResponse() overrideReturns the web response associated with the current web request.
virtual const TypeInfo& GetType() constGets actual type of object. Analog of C# System.Object.GetType() call.
HttpWebRequest(System::SharedPtr<Uri>)Constructs a new instance.
virtual bool Is(const TypeInfo&) constCheck if object represents an instance of type described by targetType. Analog of C# ‘is’ operator.
void Lock()Implements C# lock() statement locking. Call directly or use LockContext sentry object.
virtual ptr MemberwiseClone() constAnalog of C# Object.MemberwiseClone() method. Enables cloning custom types.
Object()Creates object. Initializes all internal data structures.
Object(Object const&)Copy constructor. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
Object& operator=(Object const&)Assignment operator. Doesn’t copy anything, really, just initializes new object and enables copy constructing subclasses.
static bool ReferenceEquals(ptr const&, ptr const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, T const&)Compares objects by reference.
static std::enable_if<!IsSmartPtr<T>::value, bool>::type ReferenceEquals(T const&, std::nullptr_t)Reference-compares value type object with nullptr.
bool ReferenceEquals(String const&, std::nullptr_t)Specialization of Object::ReferenceEquals for case of string and nullptr.
bool ReferenceEquals(String const&, String const&)Specialization of Object::ReferenceEquals for case of strings.
static bool RegisterPrefix(String, System::SharedPtr<IWebRequestCreate>)Registers the WebRequest descendant for the specified URI.
int RemovedSharedRefs(int)Decreases shared reference count by specified value.
void set_Accept(String)Sets the ‘Accept’ HTTP header value.
virtual void set_AllowAutoRedirect(bool)Sets a value that indicates if the request should follow redirections.
virtual void set_AllowReadStreamBuffering(bool)Sets a value indicates if the data received from the resource must be buffered.
virtual void set_AllowWriteStreamBuffering(bool)Sets a value that indicates if buffering is enabled for sending data.
virtual void set_CachePolicy(System::SharedPtr<System::Net::Cache::RequestCachePolicy>)Sets the cache policy.
virtual void set_ClientCertificates(System::SharedPtr<System::Security::Cryptography::X509Certificates::X509CertificateCollection>)Sets the collection of the certificates that are associated with the current request.
void set_ConnectionGroupName(System::String) overrideSets the name of the connection group.
void set_ContentLength(int64_t) overrideSets the number of bytes of the request data to sent.
void set_ContentType(String) overrideSets the MIME type of the request.
void set_ContinueTimeout(int32_t)Sets a timeout to wait until the 100-Continue status code is received.
virtual void set_CookieContainer(System::SharedPtr<System::Net::CookieContainer>)Sets a cookie container associated with the current web request.
void set_Credentials(System::SharedPtr<ICredentials>) overrideSets authentication information that is associated with the current request.
static void set_DefaultWebProxy(System::SharedPtr<IWebProxy>)Sets the global HTTP proxy.
void set_Headers(System::SharedPtr<WebHeaderCollection>) overrideSets the collection of the HTTP headers.
virtual void set_KeepAlive(bool)Sets a value that indicates if the current request must contain the ‘Keep-Alive’ header.
virtual void set_MaximumAutomaticRedirections(int)Sets a maximum number of allowed redirections.
void set_Method(String) overrideSets the HTTP method.
void set_PreAuthenticate(bool) overrideSets a value that indicates if the request must be pre-authenticated.
static void set_PrefixList(System::SharedPtr<Collections::Generic::List<System::SharedPtr<WebRequest::WebRequestPrefixElement>>>)Sets the prefix list.
void set_ProtocolVersion(System::Version)Sets the version of the HTTP.
void set_Proxy(System::SharedPtr<IWebProxy>) overrideSets the HTTP proxy.
virtual void set_Referer(System::String)Sets a value of the ‘Referer’ header.
virtual void set_SendChunked(bool)Sets a value that indicates if data must be sent in segments.
void set_Timeout(int) overrideSets an amount of time in milliseconds after which the request will be timed out.
virtual void set_Timeout(int32_t)Sets an amount of time in milliseconds after which the request will be timed out.
void set_UseDefaultCredentials(bool) overrideSets a value that indicates if the ‘Credential’ property is equal to the ‘DefaultCredentials’ property.
virtual void set_UserAgent(System::String)Sets a value of the ‘User-Agent’ header.
virtual void SetTemplateWeakPtr(uint32_t)Set n’th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode.
int SharedCount() constGets current value of shared reference counter.
Object * SharedRefAdded()Increments shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
int SharedRefRemovedSafe()Decrements and returns shared reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual String ToString() constAnalog of C# Object.ToString() method. Enables converting custom objects to string.
static const TypeInfo& Type()Implements C# typeof(System.Object) construct.
void Unlock()Implements C# lock() statement unlocking. Call directly or use LockContext sentry object.
Detail::SmartPtrCounter * WeakRefAdded()Increments weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
void WeakRefRemoved()Decrements weak reference count. Shouldn’t be called directly; instead, use smart pointers or ThisProtector.
virtual ~Object()Destroys object. Frees all internal data structures.

See Also