Interface IWebServerInvoker
An interface for communicating with a web service or API.
public interface IWebServerInvoker
Methods
InvokeAsync<T>(string, object?, CancellationToken)
Asynchronously invoke a call to the specified method.
Task<T?> InvokeAsync<T>(string method, object? parameters = null, CancellationToken cancellationToken = default)
Parameters
method
stringMethod to invoke.
parameters
objectAn anonymous object used as the parameters to pass into the method with corresponding parameter values, for instance: new {username = "ivant@gmail.com", password = "123"}.
cancellationToken
CancellationTokenThe CancellationToken used to signal that the request should be cancelled.
Returns
Type Parameters
T
The object type to deserialize to and return.
InvokeAsync<T>(string, string?, object?, CancellationToken)
Asynchronously invoke a call to the specified method.
Task<T?> InvokeAsync<T>(string method, string? traceId, object? parameters = null, CancellationToken cancellationToken = default)
Parameters
method
stringMethod to invoke.
traceId
stringtraceId of httpcontext
parameters
objectAn anonymous object used as the parameters to pass into the method with corresponding parameter values, for instance: new {username = "ivant@gmail.com", password = "123"}.
cancellationToken
CancellationTokenThe CancellationToken used to signal that the request should be cancelled.
Returns
Type Parameters
T
The object type to deserialize to and return.