From 5ea7f762dc4222b945cc5db0eb6fe79d83ed51c3 Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 27 Sep 2025 12:38:35 +0200 Subject: [PATCH] Try HTTP Request --- flake.nix | 1 + src/application.vala | 10 ++++++++++ src/meson.build | 1 + 3 files changed, 12 insertions(+) diff --git a/flake.nix b/flake.nix index 3855bce..b6edcfd 100644 --- a/flake.nix +++ b/flake.nix @@ -27,6 +27,7 @@ buildInputs = with pkgs; [ glib libadwaita + libsoup_3 ]; }; default = self.packages."${system}".allesapp; diff --git a/src/application.vala b/src/application.vala index bf1843c..3aa7312 100644 --- a/src/application.vala +++ b/src/application.vala @@ -60,5 +60,15 @@ public class Allesapp.Application : Adw.Application { private void on_preferences_action () { message ("app.preferences action activated"); + + var session = new Soup.Session (); + var msg = new Soup.Message ("GET", "http://ip4.clerie.de"); + + var input_stream = session.send (msg); + var data_input_stream = new DataInputStream (input_stream); + + message (data_input_stream.read_line_utf8()); + } + } diff --git a/src/meson.build b/src/meson.build index ab06def..06750e8 100644 --- a/src/meson.build +++ b/src/meson.build @@ -8,6 +8,7 @@ allesapp_deps = [ config_dep, dependency('gtk4'), dependency('libadwaita-1', version: '>= 1.4'), + dependency('libsoup-3.0'), ] allesapp_sources += gnome.compile_resources('allesapp-resources',