[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IWebRequestHandler.GetAsync

GetAsync Method

GetAsync(string)

Sends a GET request to the specified URI asynchronously.

Declaration
Task<WebRequestResult> GetAsync(string requestUri)
Function GetAsync(requestUri As String) As Task(Of WebRequestResult)
Parameters
Type Name Description
string requestUri

The URI to send the GET request to.

Returns
Type Description
Task<WebRequestResult>

A Task<TResult> representing the asynchronous operation; when completed, its result is a WebRequestResult that describes the outcome of the web request.

Examples
class WebHandler : IWebRequestHandler
{
    public Task<WebRequestResult> GetAsync(string requestUri)
    {
        WebRequestResult result = new WebRequestResult
        {
            StatusCode = 200,
            ResponseContent = new byte[] { }
        };
        return Task.FromResult(result);
    }
}
IWebRequestHandler handler = new WebHandler();
WebRequestResult result = await handler.GetAsync("https://example.com/data");