C# Class org.GraphDefined.Vanaheimr.Hermod.HTTP.HTTPClient

A http client.
Inheritance: IDisposable
Show file Open project: Vanaheimr/Hermod Class Usage Examples

Public Methods

Method Description
Close ( ) : void
CreateRequest ( HTTPMethod HTTPMethod, String URI, Action BuilderAction = null ) : HTTPRequestBuilder

Create a new HTTP request.

Dispose ( ) : void
Execute ( HTTPRequest>.Func HTTPRequestDelegate, ClientRequestLogHandler RequestLogDelegate = null, ClientResponseLogHandler ResponseLogDelegate = null, System.TimeSpan Timeout = null, CancellationToken CancellationToken = null ) : Task

Execute the given HTTP request and return its result.

Execute ( HTTPRequest Request, ClientRequestLogHandler RequestLogDelegate = null, ClientResponseLogHandler ResponseLogDelegate = null, System.TimeSpan Timeout = null, CancellationToken CancellationToken = null ) : Task

Execute the given HTTP request and return its result.

HTTPClient ( IIPAddress RemoteIPAddress, IPPort RemotePort, RemoteCertificateValidationCallback RemoteCertificateValidator = null, X509Certificate ClientCert = null, DNSClient DNSClient = null ) : System

Create a new HTTPClient using the given optional parameters.

HTTPClient ( IPSocket RemoteSocket, RemoteCertificateValidationCallback RemoteCertificateValidator = null, X509Certificate ClientCert = null, DNSClient DNSClient = null ) : System

Create a new HTTPClient using the given optional parameters.

HTTPClient ( String RemoteHost, IPPort RemotePort = null, RemoteCertificateValidationCallback RemoteCertificateValidator = null, X509Certificate ClientCert = null, DNSClient DNSClient = null ) : System

Create a new HTTPClient using the given optional parameters.

ToString ( ) : String

Returns a string representation of this object.

Method Details

Close() public method

public Close ( ) : void
return void

CreateRequest() public method

Create a new HTTP request.
public CreateRequest ( HTTPMethod HTTPMethod, String URI, Action BuilderAction = null ) : HTTPRequestBuilder
HTTPMethod HTTPMethod A HTTP method.
URI String An URI.
BuilderAction Action A delegate to configure the new HTTP request builder.
return HTTPRequestBuilder

Dispose() public method

public Dispose ( ) : void
return void

Execute() public method

Execute the given HTTP request and return its result.
public Execute ( HTTPRequest>.Func HTTPRequestDelegate, ClientRequestLogHandler RequestLogDelegate = null, ClientResponseLogHandler ResponseLogDelegate = null, System.TimeSpan Timeout = null, CancellationToken CancellationToken = null ) : Task
HTTPRequestDelegate HTTPRequest>.Func A delegate for producing a HTTP request for a given HTTP client.
RequestLogDelegate ClientRequestLogHandler A delegate for logging the HTTP request.
ResponseLogDelegate ClientResponseLogHandler A delegate for logging the HTTP request/response.
Timeout System.TimeSpan An optional timeout.
CancellationToken System.Threading.CancellationToken A cancellation token.
return Task

Execute() public method

Execute the given HTTP request and return its result.
public Execute ( HTTPRequest Request, ClientRequestLogHandler RequestLogDelegate = null, ClientResponseLogHandler ResponseLogDelegate = null, System.TimeSpan Timeout = null, CancellationToken CancellationToken = null ) : Task
Request HTTPRequest A HTTP request.
RequestLogDelegate ClientRequestLogHandler A delegate for logging the HTTP request.
ResponseLogDelegate ClientResponseLogHandler A delegate for logging the HTTP request/response.
Timeout System.TimeSpan An optional timeout.
CancellationToken System.Threading.CancellationToken A cancellation token.
return Task

HTTPClient() public method

Create a new HTTPClient using the given optional parameters.
public HTTPClient ( IIPAddress RemoteIPAddress, IPPort RemotePort, RemoteCertificateValidationCallback RemoteCertificateValidator = null, X509Certificate ClientCert = null, DNSClient DNSClient = null ) : System
RemoteIPAddress IIPAddress The remote IP address to connect to.
RemotePort IPPort The remote IP port to connect to.
RemoteCertificateValidator RemoteCertificateValidationCallback A delegate to verify the remote TLS certificate.
ClientCert System.Security.Cryptography.X509Certificates.X509Certificate The TLS client certificate to use.
DNSClient DNSClient An optional DNS client.
return System

HTTPClient() public method

Create a new HTTPClient using the given optional parameters.
public HTTPClient ( IPSocket RemoteSocket, RemoteCertificateValidationCallback RemoteCertificateValidator = null, X509Certificate ClientCert = null, DNSClient DNSClient = null ) : System
RemoteSocket IPSocket The remote IP socket to connect to.
RemoteCertificateValidator RemoteCertificateValidationCallback A delegate to verify the remote TLS certificate.
ClientCert System.Security.Cryptography.X509Certificates.X509Certificate The TLS client certificate to use.
DNSClient DNSClient An optional DNS client.
return System

HTTPClient() public method

Create a new HTTPClient using the given optional parameters.
public HTTPClient ( String RemoteHost, IPPort RemotePort = null, RemoteCertificateValidationCallback RemoteCertificateValidator = null, X509Certificate ClientCert = null, DNSClient DNSClient = null ) : System
RemoteHost String The remote hostname to connect to.
RemotePort IPPort The remote IP port to connect to.
RemoteCertificateValidator RemoteCertificateValidationCallback A delegate to verify the remote TLS certificate.
ClientCert System.Security.Cryptography.X509Certificates.X509Certificate The TLS client certificate to use.
DNSClient DNSClient An optional DNS client.
return System

ToString() public method

Returns a string representation of this object.
public ToString ( ) : String
return String