CodePorting.Translator Cs2Cpp
CodePorting.Translator.Cs2Cpp.Framework
System::Net::Http::HttpClientHandler Class Reference

Represents the default message handler used by the HttpClient class. 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. More...

#include <http_client_handler.h>

Inherits System::Net::Http::HttpMessageHandler.

Public Member Functions

 HttpClientHandler ()
 Constructs a new instance. More...
 
void Dispose () override
 Does nothing. More...
 
System::SharedPtr< HttpResponseMessageSend (System::SharedPtr< HttpRequestMessage > request) override
 Sends the specified request. More...
 
System::SharedPtr< ICredentialsget_Credentials ()
 Gets the authentication information. More...
 
void set_Credentials (System::SharedPtr< ICredentials > value)
 Sets the authentication information. More...
 
System::SharedPtr< System::Net::CookieContainerget_CookieContainer ()
 Gets the cookie container that is used to store server cookies. More...
 
void set_CookieContainer (System::SharedPtr< System::Net::CookieContainer > value)
 Sets the cookie container that is used to store server cookies. More...
 
void set_UseCookies (bool value)
 Sets the value that indicates if the current instance uses the cookie container to store server cookies and if the instance uses server cookies when sending requests. More...
 
void set_Proxy (System::SharedPtr< IWebProxy > value)
 Sets the proxy information. More...
 
void set_UseProxy (bool value)
 Sets the value that indicates if the current instance uses the proxy for sending requests. More...
 
void set_Timeout (int32_t timeout)
 Gets an amount of time in milliseconds after which the request will be timed out. More...
 
- Public Member Functions inherited from System::Net::Http::HttpMessageHandler
virtual System::SharedPtr< HttpResponseMessageSend (System::SharedPtr< HttpRequestMessage > request)=0
 Sends the specified request. More...
 
void Dispose () override
 Does nothing. More...
 
virtual void Dispose ()
 Does nothing. More...
 
- Public Member Functions inherited from System::Object
 Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ~Object ()
 Destroys object. Frees all internal data structures. More...
 
 Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared reference counter. More...
 
void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual int32_t GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual String ToString () const
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual void SetTemplateWeakPtr (uint32_t argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
virtual bool FastCast (const Details::FastRttiBase &helper, void **out_ptr) const
 For internal purposes only. More...
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 Specialization of Object::ReferenceEquals for case of string and nullptr. More...
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 Specialization of Object::ReferenceEquals for case of strings. More...
 

Protected Member Functions

void Dispose (bool disposing) override
 Does nothing. More...
 
- Protected Member Functions inherited from System::Net::Http::HttpMessageHandler
 HttpMessageHandler ()
 Constructs a new instance. More...
 
virtual void Dispose (bool disposing)
 Disposes the current instance. More...
 

Protected Attributes

System::SharedPtr< System::Net::CookieContainer_cookieContainer
 The cookie container. More...
 
System::SharedPtr< ICredentials_credentials
 The authentication information. More...
 
System::SharedPtr< IWebProxy_proxy
 The proxy information. More...
 
int32_t _timeout
 

Additional Inherited Members

- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Implements C# typeof(System.Object) construct. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 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. More...
 
template<>
bool Equals (double const &objA, double const &objB)
 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. More...
 

Detailed Description

Represents the default message handler used by the HttpClient class. 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.

Constructor & Destructor Documentation

◆ HttpClientHandler()

System::Net::Http::HttpClientHandler::HttpClientHandler ( )

Constructs a new instance.

Member Function Documentation

◆ Dispose() [1/2]

void System::Net::Http::HttpClientHandler::Dispose ( )
overridevirtual

Does nothing.

Reimplemented from System::IDisposable.

◆ Dispose() [2/2]

void System::Net::Http::HttpClientHandler::Dispose ( bool  disposing)
overrideprotectedvirtual

Does nothing.

Reimplemented from System::Net::Http::HttpMessageHandler.

◆ get_CookieContainer()

System::SharedPtr< System::Net::CookieContainer > System::Net::Http::HttpClientHandler::get_CookieContainer ( )

Gets the cookie container that is used to store server cookies.

Returns
The cookie container that is used to store server cookies.

◆ get_Credentials()

System::SharedPtr< ICredentials > System::Net::Http::HttpClientHandler::get_Credentials ( )

Gets the authentication information.

Returns
The authentication information.

◆ Send()

System::SharedPtr< HttpResponseMessage > System::Net::Http::HttpClientHandler::Send ( System::SharedPtr< HttpRequestMessage request)
overridevirtual

Sends the specified request.

Parameters
requestThe request to send.
Returns
The HTTP response message.

Implements System::Net::Http::HttpMessageHandler.

◆ set_CookieContainer()

void System::Net::Http::HttpClientHandler::set_CookieContainer ( System::SharedPtr< System::Net::CookieContainer value)

Sets the cookie container that is used to store server cookies.

Parameters
valueThe value that will be set.

◆ set_Credentials()

void System::Net::Http::HttpClientHandler::set_Credentials ( System::SharedPtr< ICredentials value)

Sets the authentication information.

Parameters
valueThe value that will be set.

◆ set_Proxy()

void System::Net::Http::HttpClientHandler::set_Proxy ( System::SharedPtr< IWebProxy value)

Sets the proxy information.

Parameters
valueThe value that will be set.

◆ set_Timeout()

void System::Net::Http::HttpClientHandler::set_Timeout ( int32_t  timeout)

Gets an amount of time in milliseconds after which the request will be timed out.

Parameters
timeoutAn amount of time in milliseconds after which the request will be timed out.

◆ set_UseCookies()

void System::Net::Http::HttpClientHandler::set_UseCookies ( bool  value)

Sets the value that indicates if the current instance uses the cookie container to store server cookies and if the instance uses server cookies when sending requests.

Parameters
valueThe value that will be set.

◆ set_UseProxy()

void System::Net::Http::HttpClientHandler::set_UseProxy ( bool  value)

Sets the value that indicates if the current instance uses the proxy for sending requests.

Parameters
valueThe value that will be set.

Member Data Documentation

◆ _cookieContainer

System::SharedPtr<System::Net::CookieContainer> System::Net::Http::HttpClientHandler::_cookieContainer
protected

The cookie container.

◆ _credentials

System::SharedPtr<ICredentials> System::Net::Http::HttpClientHandler::_credentials
protected

The authentication information.

◆ _proxy

System::SharedPtr<IWebProxy> System::Net::Http::HttpClientHandler::_proxy
protected

The proxy information.

◆ _timeout

int32_t System::Net::Http::HttpClientHandler::_timeout
protected