append webservice and result type parts to base piwigo url

This commit is contained in:
Philipp Häfelfinger 2022-11-19 10:01:54 +01:00
parent 3197ac24ea
commit 5952664e2b

View File

@ -1,4 +1,5 @@
using System.Net; using System.Net;
using Flurl;
using Flurl.Http; using Flurl.Http;
using Flurl.Http.Content; using Flurl.Http.Content;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
@ -132,7 +133,8 @@ public class PiwigoContext : IPiwigoContext
throw new ArgumentNullException(nameof(logger)); 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) private static async Task LogResponse(FlurlCall call, ILogger logger)