Add standard methods for GET,POST,PUT,PATCH,DELETE
Here is an example for GET
private async Task<Result<String>> SendGetRequest(String uri, String accessToken, CancellationToken cancellationToken) {
HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, uri);
requestMessage.Headers.Authorization = new AuthenticationHeaderValue(AuthenticationSchemes.Bearer, accessToken);
// Make the Http Call here
HttpResponseMessage httpResponse = await this.HttpClient.SendAsync(requestMessage, cancellationToken);
// Process the response
Result<String> result = await this.HandleResponseX(httpResponse, cancellationToken);
if (result.IsFailed)
return ResultHelpers.CreateFailure(result);
return Result.Success<String>(result.Data);
}
Methods that take in content such as POST could they be gerneric of type T?
Add standard methods for GET,POST,PUT,PATCH,DELETE
Here is an example for GET
Methods that take in content such as POST could they be gerneric of type T?