diff --git a/CHANGELOG.md b/CHANGELOG.md
index f5f7e284..c3de839c 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+## [1.3.5] - 2023-10-05
+
+### Changed
+
+- Uses headers try add when setting the content type.
+
## [1.3.4] - 2023-10-04
### Changed
diff --git a/src/Microsoft.Kiota.Abstractions.csproj b/src/Microsoft.Kiota.Abstractions.csproj
index 0cd3dfca..31466815 100644
--- a/src/Microsoft.Kiota.Abstractions.csproj
+++ b/src/Microsoft.Kiota.Abstractions.csproj
@@ -14,7 +14,7 @@
https://aka.ms/kiota/docs
true
true
- 1.3.4
+ 1.3.5
true
false
diff --git a/src/RequestInformation.cs b/src/RequestInformation.cs
index b9485a91..70b4ab18 100644
--- a/src/RequestInformation.cs
+++ b/src/RequestInformation.cs
@@ -195,7 +195,7 @@ public void SetStreamContent(Stream content)
using var activity = _activitySource?.StartActivity(nameof(SetStreamContent));
SetRequestType(content, activity);
Content = content;
- Headers.Add(ContentTypeHeader, BinaryContentType);
+ Headers.TryAdd(ContentTypeHeader, BinaryContentType);
}
private static ActivitySource _activitySource = new(typeof(RequestInformation).Namespace!);
///
@@ -211,7 +211,7 @@ public void SetContentFromParsable(IRequestAdapter requestAdapter, string con
using var writer = GetSerializationWriter(requestAdapter, contentType, items);
SetRequestType(items.FirstOrDefault(static x => x != null), activity);
writer.WriteCollectionOfObjectValues(null, items);
- Headers.Add(ContentTypeHeader, contentType);
+ Headers.TryAdd(ContentTypeHeader, contentType);
Content = writer.GetSerializedContent();
}
///
@@ -232,7 +232,7 @@ public void SetContentFromParsable(IRequestAdapter requestAdapter, string con
mpBody.RequestAdapter = requestAdapter;
}
writer.WriteObjectValue(null, item);
- Headers.Add(ContentTypeHeader, contentType);
+ Headers.TryAdd(ContentTypeHeader, contentType);
Content = writer.GetSerializedContent();
}
private static void SetRequestType(object? result, Activity? activity)
@@ -261,7 +261,7 @@ public void SetContentFromScalarCollection(IRequestAdapter requestAdapter, st
using var writer = GetSerializationWriter(requestAdapter, contentType, items);
SetRequestType(items.FirstOrDefault(static x => x != null), activity);
writer.WriteCollectionOfPrimitiveValues(null, items);
- Headers.Add(ContentTypeHeader, contentType);
+ Headers.TryAdd(ContentTypeHeader, contentType);
Content = writer.GetSerializedContent();
}
///
@@ -323,7 +323,7 @@ public void SetContentFromScalar(IRequestAdapter requestAdapter, string conte
default:
throw new InvalidOperationException($"error serialization data value with unknown type {item?.GetType()}");
}
- Headers.Add(ContentTypeHeader, contentType);
+ Headers.TryAdd(ContentTypeHeader, contentType);
Content = writer.GetSerializedContent();
}
}