Skip to content

Commit

Permalink
Fix AddAsync and UpdateAsync in Flux.Rest (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
ligowsky authored May 6, 2024
1 parent d0a129d commit d7ae3a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/BitzArt.Flux.REST/Models/FluxRestSetContext{TModel}.cs
Original file line number Diff line number Diff line change
@@ -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;

Expand Down Expand Up @@ -133,7 +134,7 @@ public override async Task<TResponse> AddAsync<TResponse>(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<TResponse>(message);
Expand All @@ -160,7 +161,7 @@ public override async Task<TResponse> UpdateAsync<TResponse>(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<TResponse>(message);
Expand Down

0 comments on commit d7ae3a7

Please sign in to comment.