Skip to content

Make Request mutable for HttpClient #4492

@heaths

Description

@heaths

The main reason we have Clone constraints on request-related types is because the HttpClient trait requires an immutable Request, but reqwest::Client wants a mutable request. The original intent - as found in the legacy branch - was that a client - the transport, really - shouldn't mutate the request. In concept that makes sense: only Policy implementations were intended to do that. However, this prevents us from effectively streaming request bodies without jumping through hooks like in #4491.

Should we ever cut a 2.0 release with breaking changes, we should reconsider making the Request mutable, as would be necessary to stream the request body. This should allow us to remove the Clone constraint and clean up a lot of code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Azure.CoreThe azure_core crateClientThis issue points to a problem in the data-plane of the library.breaking-change
    No fields configured for Feature.

    Projects

    Status
    Untriaged

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions