diff --git a/src/Piwigo.Client/PiwigoContext.cs b/src/Piwigo.Client/PiwigoContext.cs index c060b57..1c4d3e4 100644 --- a/src/Piwigo.Client/PiwigoContext.cs +++ b/src/Piwigo.Client/PiwigoContext.cs @@ -1,4 +1,5 @@ using System.Net; +using Flurl; using Flurl.Http; using Flurl.Http.Content; using Microsoft.Extensions.Logging; @@ -132,7 +133,8 @@ public class PiwigoContext : IPiwigoContext throw new ArgumentNullException(nameof(logger)); } - return _config.BaseUri.WithCookies(_cookies).ConfigureRequest(r => r.AfterCallAsync = call => LogResponse(call, logger)); + return _config.BaseUri.AppendPathSegment("ws.php").SetQueryParam("format", "json").WithCookies(_cookies) + .ConfigureRequest(r => r.AfterCallAsync = call => LogResponse(call, logger)); } private static async Task LogResponse(FlurlCall call, ILogger logger)