feat: httpClient header
This commit is contained in:
13
src/main.zig
13
src/main.zig
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user