Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AddAsync and UpdateAsync in Flux.Rest #26

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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