Background and motivation
With the new QUERY verb reaching the Proposed Standard maturity level, now might be the right time to add it to HttpClient.
API Proposal
These methods added to HttpClient:
namespace System.Net.Http;
public partial class HttpClient : HttpMessageInvoker
{
// Exactly the same shape as PostAsync, just replacing the method name
public Task<HttpResponseMessage> QueryAsync([StringSyntax("Uri")] string? requestUri, HttpContent? content);
public Task<HttpResponseMessage> QueryAsync([StringSyntax("Uri")] string? requestUri, HttpContent? content, CancellationToken cancellationToken);
public Task<HttpResponseMessage> QueryAsync(Uri? requestUri, HttpContent? content);
public Task<HttpResponseMessage> QueryAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
}
API Usage
This is intended to be used in the same way the current verbs with a body are used.
HttpClient httpClient = new();
var response = await httpClient.QueryAsync("https://myuri.com/path", someHttpContent);
Alternative Designs
No response
Risks
No response
Background and motivation
With the new QUERY verb reaching the Proposed Standard maturity level, now might be the right time to add it to
HttpClient.API Proposal
These methods added to
HttpClient:API Usage
This is intended to be used in the same way the current verbs with a body are used.
Alternative Designs
No response
Risks
No response