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
| Edit this page View SourceBaseHttpConnector()
Creates a new connector.
Declaration
protected BaseHttpConnector()
BaseHttpConnector(HttpClientHandler)
Creates a new connector.
Declaration
protected BaseHttpConnector(HttpClientHandler clientHandler)
Parameters
Type | Name | Description |
---|---|---|
HttpClientHandler | clientHandler | The handler to use for HTTP client connections. |
Properties
| Edit this page View SourceHttpClient
Get the HTTP client to be used.
Declaration
public HttpClient HttpClient { get; }
Property Value
Type | Description |
---|---|
HttpClient |
HttpClientHandler
Get the handler used by the HTTP client.
Declaration
protected HttpClientHandler HttpClientHandler { get; }
Property Value
Type | Description |
---|---|
HttpClientHandler |
Proxy
Gets/Sets a Proxy Server to be used.
Declaration
public IWebProxy Proxy { get; set; }
Property Value
Type | Description |
---|---|
IWebProxy |
ProxyCredentials
Gets/Sets Credentials to be used for Proxy Server.
Declaration
public ICredentials ProxyCredentials { get; set; }
Property Value
Type | Description |
---|---|
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 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
| Edit this page 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 |
---|---|---|
bool | 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 |
---|---|---|
Uri | address | Proxy Address. |
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. |
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. |