@ -442,9 +442,8 @@ class DynamiteClient {
final Set<int>? validStatuses,
) async {
final request = await httpClient.openUrl(method, uri);
for (final header in headers.entries) {
request.headers.add(header.key, header.value);
}
request.headers.addAll(headers);
if (body != null) {
request.add(body);
@ -41,3 +41,13 @@ extension HttpClientResponseExtension on HttpClientResponse {
return responseHeaders;
/// Extension for http headers.
extension HttpHeadersExtension on HttpHeaders {
/// Iteratively adds all header values.
void addAll(final Map<String, String> headers) {
add(header.key, header.value);
@ -32,14 +32,13 @@ class WebDavClient {
final request = await rootClient.httpClient.openUrl(method, url)
..persistentConnection = true;
for (final header in {
request.headers.addAll({
HttpHeaders.contentTypeHeader: 'application/xml',
...?rootClient.baseHeaders,
...?headers,
...?rootClient.authentications.firstOrNull?.headers,
}.entries) {
});
if (data != null) {
request.add(data);