@MustBeClosed
    public static SafeCloseable withHeaders(Consumer<HttpHeadersBuilder> headerMutator) {
        requireNonNull(headerMutator, "headerMutator");
        return withContextCustomizer(ctx -> {
            ctx.mutateAdditionalRequestHeaders(headerMutator);
        });
    }
Sets the specified {@link Consumer}, which mutates HTTP headers, in a thread-local variable so that the
mutated headers are sent by the client call made from the current thread.
Use the {@code try-with-resources} block with the returned {@link SafeCloseable} to unset the
thread-local variable automatically:
<pre>{@code
import static com.linecorp.armeria.common.HttpHeaderNames.AUTHORIZATION;
import static com.linecorp.armeria.common.HttpHeaderNames.USER_AGENT;

try (SafeCloseable ignored = withHeaders(builder -> {
    builder.set(HttpHeaders.AUTHORIZATION, myCredential)
           .set(HttpHeaders.USER_AGENT, myAgent);
})) {
    client.executeSomething(..);
}
}</pre>
You can also nest the header mutation:
<pre>{@code
import static com.linecorp.armeria.common.HttpHeaderNames.AUTHORIZATION;
import static com.linecorp.armeria.common.HttpHeaderNames.USER_AGENT;

try (SafeCloseable ignored = withHeaders(builder -> {
         builder.set(USER_AGENT, myAgent);
     })) {
    for (String secret : secrets) {
        try (SafeCloseable ignored2 = withHeaders(builder -> {
                 builder.set(AUTHORIZATION, secret);
             })) {
            // Both USER_AGENT and AUTHORIZATION will be set.
            client.executeSomething(..);
        }
    }
}
}</pre>

<p>Note that the mutated headers will be stored into
{@link ClientRequestContext#additionalRequestHeaders()} which takes precedence over
{@link HttpRequest#headers()}.

@see #withHeader(CharSequence, String)
core/src/main/java/com/linecorp/armeria/client/Clients.java