Class HttpWebRequestFactory
The request factory for System.Net.HttpWebRequest.
public class HttpWebRequestFactory : IHttpRequestFactory<Stream>, IDisposable
- Inheritance
-
HttpWebRequestFactory
- Implements
- Inherited Members
Constructors
HttpWebRequestFactory(IAmazonSecurityProtocolManager)
Some AWS services like Cloud 9 require at least TLS 1.1. Version of .NET Framework 4.5 and earlier do not eanble TLS 1.1 and TLS 1.2 by default. This code adds those protocols if using an earlier version of .NET that explicitly set the protocol and didn't have TLS 1.1 and TLS 1.2.
public HttpWebRequestFactory(IAmazonSecurityProtocolManager amazonSecurityProtocolManager)
Parameters
amazonSecurityProtocolManager
IAmazonSecurityProtocolManager
HttpWebRequestFactory(IAmazonSecurityProtocolManager, ILogger)
Some AWS services like Cloud 9 require at least TLS 1.1. Version of .NET Framework 4.5 and earlier do not eanble TLS 1.1 and TLS 1.2 by default. This code adds those protocols if using an earlier version of .NET that explicitly set the protocol and didn't have TLS 1.1 and TLS 1.2.
public HttpWebRequestFactory(IAmazonSecurityProtocolManager amazonSecurityProtocolManager, ILogger logger)
Parameters
amazonSecurityProtocolManager
IAmazonSecurityProtocolManagerlogger
ILogger
Methods
CreateHttpRequest(Uri)
Creates an HTTP request for the given URI.
public IHttpRequest<Stream> CreateHttpRequest(Uri requestUri)
Parameters
requestUri
UriThe request URI.
Returns
- IHttpRequest<Stream>
An HTTP request.
Dispose()
Disposes the HttpWebRequestFactory.
public void Dispose()
Dispose(bool)
protected virtual void Dispose(bool disposing)
Parameters
disposing
bool
SetIsProtocolUpdated(bool)
This method is used for unit testing purposes. It allows setting of the flag that indicates protocol setting was attempted.
public static void SetIsProtocolUpdated(bool value)
Parameters
value
boolThe new value