-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Net.Http
Milestone
Description
It seems obvious that there is a lack of external cancellation support in a few HttpClient methods: GetByteArrayAsync, GetStreamAsync and maybe others. Any particular reason?
What is expected:
class HttpClient {
public Task<byte[]> GetByteArrayAsync(string requestUri, CancellationToken token = default);
public Task<byte[]> GetByteArrayAsync(Uri requestUri, CancellationToken token = default);
public Task<byte[]> GetStreamAsync(string requestUri, CancellationToken token = default);
public Task<byte[]> GetStreamAsync(Uri requestUri, CancellationToken token = default);
public Task<byte[]> GetStringAsync(string requestUri, CancellationToken token = default);
public Task<byte[]> GetStringAsync(Uri requestUri, CancellationToken token = default);
}
class HttpContent {
public Task<byte[]> GetByteArrayAsync(CancellationToken token = default);
public Task<byte[]> GetStreamAsync(CancellationToken token = default);
public Task<byte[]> GetStringAsync(CancellationToken token = default);
}I might be not alone here. If missed another case or the feature is in the pipeline already, then comment to the case and close as a duplicate.
Thanks.
P.S.
GetByteArrayAsync is another overload candidate mentioned by dotnet/corefx#32762.
jnm2, cwe1ss, Rinsen, NickCraver, LeonidVasilyev and 5 more
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Net.Http