#7 add simple send dialog

This commit is contained in:
seba
2024-12-17 22:54:24 +01:00
parent cb55d0148d
commit c7e02655b0
7 changed files with 603 additions and 239 deletions

View File

@@ -6,6 +6,7 @@ using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Net.WebSockets;
using System.Text;
using System.Threading;
@@ -350,5 +351,11 @@ namespace ntfysh_client.Notifications
//Remove the old topic
SubscribedTopicsByUnique.Remove(topicUniqueString);
}
public async Task<HttpResponseMessage> SendNotification(string host, NtfyEvent message)
{
var httpClient = new HttpClient();
return await httpClient.PostAsJsonAsync<NtfyEvent>(host, message);
}
}
}