feat: httpClient header

This commit is contained in:
2025-05-22 14:57:53 +02:00
parent 05dd597a1d
commit c8be63e589
2 changed files with 44 additions and 5 deletions

View File

@@ -90,9 +90,16 @@ pub fn send_doorbell_notification() !void {
var client = &httpClient.Client{ .allocator = allocator };
const request = &httpClient.HttpRequest{ .method = .POST, .url = try std.Uri.parse(appSettings.ntfy_url), .body = "Csengo", .headers = &[_]httpClient.HttpHeader{
httpClient.HttpHeader{ .name = "Title", .value = "Csengo" },
} };
const request = &httpClient.HttpRequest{
.method = .POST,
.url = try std.Uri.parse(appSettings.ntfy_url),
.body = "Csengo",
.headers = &[_]httpClient.HttpHeader{
.{ .name = "Title", .value = "Csengo" },
.{ .name = "Priority", .value = "5" },
.{ .name = "X-Tags", .value = "bell" },
},
};
const response = try client.sendRequest(request);
if (response) |r| {
defer allocator.destroy(r);