Skip to content

Commit

Permalink
fix-null-body-csharp (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
barnuri authored Aug 29, 2024
1 parent a3a4110 commit 3f8bc74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/generators/client/CSharpClientGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ using System.Runtime.Serialization;
{
Method = new HttpMethod(method),
RequestUri = new Uri($"{ClientSettings.BaseUrl.TrimEnd('/')}/{path.TrimStart('/')}"),
Content = new StringContent(JsonConvert.SerializeObject(body), null, "application/json"),
Content = body != null ? new StringContent(JsonConvert.SerializeObject(body), null, "application/json") : null,
};
headers?.Keys.ToList().ForEach(x => req.Headers.TryAddWithoutValidation(x, headers[x]));
await ClientSettings.PreRequest?.Invoke(req);
Expand Down

0 comments on commit 3f8bc74

Please sign in to comment.