Class BaseHttpConnector
Abstract Base Class for HTTP based Storage API implementations.
Implements
Inherited Members
Namespace: VDS.RDF.Storage
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseHttpConnector : IDisposable
Constructors
| Improve this Doc View SourceBaseHttpConnector()
Creates a new connector.
Declaration
protected BaseHttpConnector()
BaseHttpConnector(HttpClientHandler)
Creates a new connector.
Declaration
protected BaseHttpConnector(HttpClientHandler clientHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Net.Http.HttpClientHandler | clientHandler | The handler to use for HTTP client connections. |
Properties
| Improve this Doc View SourceHttpClient
Get the HTTP client to be used.
Declaration
public HttpClient HttpClient { get; }
Property Value
Type | Description |
---|---|
System.Net.Http.HttpClient |
HttpClientHandler
Get the handler used by the HTTP client.
Declaration
protected HttpClientHandler HttpClientHandler { get; }
Property Value
Type | Description |
---|---|
System.Net.Http.HttpClientHandler |
Proxy
Gets/Sets a Proxy Server to be used.
Declaration
public IWebProxy Proxy { get; set; }
Property Value
Type | Description |
---|---|
System.Net.IWebProxy |
ProxyCredentials
Gets/Sets Credentials to be used for Proxy Server.
Declaration
public ICredentials ProxyCredentials { get; set; }
Property Value
Type | Description |
---|---|
System.Net.ICredentials |
Timeout
Gets/Sets the HTTP Timeouts used specified in milliseconds.
Declaration
public int Timeout { get; set; }
Property Value
Type | Description |
---|---|
int |
Remarks
Defaults to 30 seconds (i.e. the default value is 30,000).
It is important to understand that this timeout only applies to the HTTP request portions of any operation performed and that the timeout may apply more than once if a POST operation is used since the timeout applies separately to obtaining the request stream to POST the request and obtaining the response stream. Also the timeout does not in any way apply to subsequent work that may be carried out before the operation can return so if you need a hard timeout on an operation you should manage that yourself.
When set to a zero/negative value then the standard .Net timeout of 100 seconds will apply, use System.Int32.MaxValue if you want the maximum possible timeout i.e. if you expect to launch extremely long running operations.
Not supported under Silverlight, Windows Phone and Portable Class Library builds.
Methods
| Improve this Doc View SourceClearProxy()
Clears any in-use credentials so subsequent requests will not use a proxy server.
Declaration
public void ClearProxy()
ClearProxyCredentials()
Clears the in-use proxy credentials so subsequent requests still use the proxy server but without credentials.
Declaration
public void ClearProxyCredentials()
Dispose()
Declaration
public void Dispose()
Dispose(bool)
Perform cleanup of managed resources held by this class.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
SerializeStandardConfig(INode, ConfigurationSerializationContext)
Helper method which adds standard configuration information (proxy and timeout settings) to serialized configuration.
Declaration
protected void SerializeStandardConfig(INode objNode, ConfigurationSerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
INode | objNode | Object Node representing the IStorageProvider whose configuration is being serialized. |
ConfigurationSerializationContext | context | Serialization Context. |
SetCredentials(string, string)
Set the credentials for the connector to use for authenticating HTTP requests.
Declaration
public void SetCredentials(string username, string password)
Parameters
Type | Name | Description |
---|---|---|
string | username | The user name to use. |
string | password | The password to use. |
SetProxy(string)
Sets a Proxy Server to be used.
Declaration
public void SetProxy(string address)
Parameters
Type | Name | Description |
---|---|---|
string | address | Proxy Address. |
SetProxy(Uri)
Sets a Proxy Server to be used.
Declaration
public void SetProxy(Uri address)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | address | Proxy Address. |
SetProxyCredentials(string, string, string)
Sets Credentials to be used for Proxy Server.
Declaration
public void SetProxyCredentials(string username, string password, string domain)
Parameters
Type | Name | Description |
---|---|---|
string | username | Username. |
string | password | Password. |
string | domain | Domain. |
SetProxyCredentials(string, string)
Sets Credentials to be used for Proxy Server.
Declaration
public void SetProxyCredentials(string username, string password)
Parameters
Type | Name | Description |
---|---|---|
string | username | Username. |
string | password | Password. |