예제 #1
0
        private async Task PostAsync(TestNotification request)
        {
            var options = GetOptions(request.UserId);

            var body = new Dictionary <string, string>
            {
                { "token", options.Token },
                { "user", options.UserKey },
                { "title", "Test Notification" },
                { "message", "This is a test notification from Jellyfin" }
            };

            _logger.LogDebug("Pushover <TEST> to {0} - {1}", options.Token, options.UserKey);

            var requestOptions = new HttpRequestOptions
            {
                Url                  = PluginConfiguration.Url,
                RequestContent       = _jsonSerializer.SerializeToString(body),
                RequestContentType   = "application/json",
                LogErrorResponseBody = true
            };

            await _httpClient.Post(requestOptions).ConfigureAwait(false);
        }
예제 #2
0
 public void Post(TestNotification request)
 {
     PostAsync(request)
     .GetAwaiter()
     .GetResult();
 }