diff --git a/TeXmacs/progs/prog/glue-symbols.scm b/TeXmacs/progs/prog/glue-symbols.scm index 70b42bb5e4..290e44312f 100644 --- a/TeXmacs/progs/prog/glue-symbols.scm +++ b/TeXmacs/progs/prog/glue-symbols.scm @@ -1126,5 +1126,5 @@ "show-meminfo" "edit-special" "xmacs-version" -"http-head" +"http-status-code" )) diff --git a/src/Scheme/L2/glue_lolly.lua b/src/Scheme/L2/glue_lolly.lua index 3b2ddf8677..7674c7cb20 100644 --- a/src/Scheme/L2/glue_lolly.lua +++ b/src/Scheme/L2/glue_lolly.lua @@ -920,9 +920,9 @@ function main() } }, { - scm_name = "http-head", - cpp_name = "lolly::io::http_head", - ret_type = "tree", + scm_name = "http-status-code", + cpp_name = "http_status_code", + ret_type = "long", arg_list = { "url" } diff --git a/src/Scheme/L2/init_glue_l2.cpp b/src/Scheme/L2/init_glue_l2.cpp index 1c9b089059..555bde7450 100644 --- a/src/Scheme/L2/init_glue_l2.cpp +++ b/src/Scheme/L2/init_glue_l2.cpp @@ -19,12 +19,16 @@ #include "file.hpp" #include "locale.hpp" #include "lolly/io/http.hpp" +#include "lolly/io/http_response.hpp" #include "lolly/system/subprocess.hpp" #include "sys_utils.hpp" #include "tree.hpp" #include "scheme.hpp" +using lolly::io::http_head; +using lolly::io::http_response_label; + tmscm blackboxP (tmscm t) { bool b= tmscm_is_blackbox (t); @@ -54,6 +58,13 @@ lolly_version () { return string (LOLLY_VERSION); } +long +http_status_code (url u) { + long status_code= as ( + http_response_ref (http_head (u), http_response_label::STATUS_CODE)); + return status_code; +} + #include "glue_lolly.cpp" void