-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Closed as not planned
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Net.Http
Description
Background and motivation
I propose adding a property called ClientHandler to HttpClient, which would allow direct access to the underlying HttpClientHandler. When creating an instance of HttpClient, parameters like cookies or connection settings can be configured. However, once the object is passed to a class, there's no way to modify these settings further.
сlass Test(HttpClient client)
{
public void Execute()
{
// In this class, it's impossible to configure cookies or other parameters
}
}
API Proposal
class HttpClient
{
public HttpClientHandler ClientHandler {get;}
}
API Usage
var message = new HttpClientHandler();
var client = new HttpClient(message);
void Execute(HttpClient client)
{
client.ClientHandler.CookieContainer = null;
}
Alternative Designs
No response
Risks
No response
julealgon
Metadata
Metadata
Assignees
Labels
api-suggestionEarly API idea and discussion, it is NOT ready for implementationEarly API idea and discussion, it is NOT ready for implementationarea-System.Net.Http