You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/src/NzbDrone.Core/Notifications/Gotify/GotifyProxy.cs

27 lines
820 B

using RestSharp;
using NzbDrone.Core.Rest;
namespace NzbDrone.Core.Notifications.Gotify
{
public interface IGotifyProxy
{
void SendNotification(string title, string message, GotifySettings settings);
}
public class GotifyProxy : IGotifyProxy
{
public void SendNotification(string title, string message, GotifySettings settings)
{
var client = RestClientFactory.BuildClient(settings.Server);
var request = new RestRequest("message", Method.POST);
request.AddQueryParameter("token", settings.AppToken);
request.AddParameter("title", title);
request.AddParameter("message", message);
request.AddParameter("priority", settings.Priority);
client.ExecuteAndValidate(request);
}
}
}