Class BaseEndpoint
Abstract Base class for HTTP endpoints.
Implements
Inherited Members
Namespace: VDS.RDF
Assembly: dotNetRdf.dll
Syntax
public abstract class BaseEndpoint : IConfigurationSerializable
Constructors
| Improve this Doc View SourceBaseEndpoint()
Creates a new Base Endpoint.
Declaration
protected BaseEndpoint()
BaseEndpoint(Uri)
Creates a new Base Endpoint.
Declaration
protected BaseEndpoint(Uri endpointUri)
Parameters
Type | Name | Description |
---|---|---|
System.Uri | endpointUri | Endpoint URI. |
Properties
| Improve this Doc View SourceCredentials
Gets the HTTP authentication credentials to be used to access the endpoint.
Declaration
public NetworkCredential Credentials { get; set; }
Property Value
Type | Description |
---|---|
System.Net.NetworkCredential |
HttpMode
Gets/Sets the HTTP Mode used for requests.
Declaration
public virtual string HttpMode { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
This property defaults to the value AUTO. in AUTO mode GET will be used unless the total length of query parameters exceeeds 2048 characters or the query contains non-ASCII characters, and POST will be used for longer queries or where the query contains non-ASCII characters.
Only AUTO, GET and POST are permitted - implementations may override this property if they wish to support more methods.
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 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.
Uri
Gets the Endpoints URI.
Declaration
public Uri Uri { get; }
Property Value
Type | Description |
---|---|
System.Uri |
UseCredentialsForProxy
Controls whether the Credentials set with the SetCredentials() method or the Credentialsare also used for a Proxy (if used).
Declaration
public bool UseCredentialsForProxy { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
UserAgent
Gets/Sets the user agent string to pass in the request header.
Declaration
public string UserAgent { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Defaults to null, which will not set the header.
Methods
| Improve this Doc View SourceApplyCustomRequestOptions(HttpWebRequest)
Method which may be overridden in derived classes to add any additional custom request options/headers to the request.
Declaration
protected virtual void ApplyCustomRequestOptions(HttpWebRequest httpRequest)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpWebRequest | httpRequest | HTTP Request. |
Remarks
This is called at the end of ApplyRequestOptions(HttpWebRequest) so can also be used to override that methods default behaviour.
ApplyRequestOptions(HttpWebRequest)
Applies generic request options (timeout, authorization and proxy server) to a request.
Declaration
protected void ApplyRequestOptions(HttpWebRequest httpRequest)
Parameters
Type | Name | Description |
---|---|---|
System.Net.HttpWebRequest | httpRequest | HTTP Request. |
ClearCredentials()
Clears any in-use credentials so subsequent requests will not use HTTP authentication.
Declaration
public void ClearCredentials()
ClearProxy()
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()
SerializeConfiguration(ConfigurationSerializationContext)
Serializes the endpoints Credential and Proxy information.
Declaration
public virtual void SerializeConfiguration(ConfigurationSerializationContext context)
Parameters
Type | Name | Description |
---|---|---|
ConfigurationSerializationContext | context | Configuration Serialization Context. |
SetCredentials(string, string, string)
Sets the HTTP Digest authentication credentials to be used.
Declaration
public void SetCredentials(string username, string password, string domain)
Parameters
Type | Name | Description |
---|---|---|
string | username | Username. |
string | password | Password. |
string | domain | Domain. |
SetCredentials(string, string)
Sets the HTTP Digest authentication credentials to be used.
Declaration
public void SetCredentials(string username, string password)
Parameters
Type | Name | Description |
---|---|---|
string | username | Username. |
string | password | Password. |
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. |