From 09b38d52f4863f560180801dd4d422c85fcb9098 Mon Sep 17 00:00:00 2001 From: Vladimir Seldemirov Date: Mon, 6 May 2024 19:48:24 +0400 Subject: [PATCH] Fix AddAsync and UpdateAsync in Flux.Rest --- src/BitzArt.Flux.REST/Models/FluxRestSetContext{TModel}.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/BitzArt.Flux.REST/Models/FluxRestSetContext{TModel}.cs b/src/BitzArt.Flux.REST/Models/FluxRestSetContext{TModel}.cs index 24a7d26..3f903f8 100644 --- a/src/BitzArt.Flux.REST/Models/FluxRestSetContext{TModel}.cs +++ b/src/BitzArt.Flux.REST/Models/FluxRestSetContext{TModel}.cs @@ -1,6 +1,7 @@ using BitzArt.Pagination; using Microsoft.Extensions.Logging; using System.Linq.Expressions; +using System.Text; using System.Text.Json; using System.Web; @@ -133,7 +134,7 @@ public override async Task AddAsync(TModel model, params o var jsonString = JsonSerializer.Serialize(model, ServiceOptions.SerializerOptions); var message = new HttpRequestMessage(HttpMethod.Post, parse.Result) { - Content = new StringContent(jsonString) + Content = new StringContent(jsonString, Encoding.UTF8, "application/json") }; var result = await HandleRequestAsync(message); @@ -160,7 +161,7 @@ public override async Task UpdateAsync(object? id, TModel var message = new HttpRequestMessage(method, path.Result) { - Content = new StringContent(jsonString) + Content = new StringContent(jsonString, Encoding.UTF8, "application/json") }; var result = await HandleRequestAsync(message);