From 3a8c2cf4b0aa5c5e12a79734df9ba99cd1e883e0 Mon Sep 17 00:00:00 2001 From: Peter Harpending Date: Tue, 23 Sep 2025 16:31:38 -0700 Subject: [PATCH] add qhl header file --- README.md | 40 ++++++++++++++++++++++++++++++++++++++ gex_httpd/include/http.hrl | 25 ++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 gex_httpd/include/http.hrl diff --git a/README.md b/README.md index ad3d943..fe77a64 100644 --- a/README.md +++ b/README.md @@ -765,3 +765,43 @@ index 7111f2d..09d84c2 100644 -{type,app}. {ws_url,"https://git.qpq.swiss/QPQ-AG/gex"}. ``` + +### Adding the QHL header file + +```bash +wget https://git.qpq.swiss/QPQ-AG/QHL/raw/branch/master/include/http.hrl -O gex_httpd/include/http.hrl +``` + +```diff +diff --git a/gex_httpd/include/http.hrl b/gex_httpd/include/http.hrl +new file mode 100644 +index 0000000..27d24d2 +--- /dev/null ++++ b/gex_httpd/include/http.hrl +@@ -0,0 +1,25 @@ ++-record(request, ++ {method = undefined :: undefined | method(), ++ path = undefined :: undefined | binary(), ++ qargs = undefined :: undefined | #{Key :: binary() := Value :: binary()}, ++ fragment = undefined :: undefined | none | binary(), ++ version = undefined :: undefined | http10 | http11 | http20, ++ headers = undefined :: undefined | [{Key :: binary(), Value :: binary()}], ++ cookies = undefined :: undefined | #{Key :: binary() := Value :: binary()}, ++ enctype = undefined :: undefined | none | urlencoded | multipart(), ++ size = undefined :: undefined | none | non_neg_integer(), ++ body = undefined :: undefined | none | body()}). ++ ++-record(response, ++ {type = page :: page | {data, string()}, ++ version = http11 :: http11, ++ code = 200 :: pos_integer(), ++ slogan = "" :: string(), ++ headers = [] :: [{Key :: string(), Value :: iolist()}], ++ body = "" :: iolist()}). ++ ++-type method() :: get | post | options. ++-type multipart() :: {multipart, Boundary :: binary()}. ++-type body() :: {partial, binary()} | {multipart, [body_part()]} | binary(). ++-type body_part() :: {Field :: binary(), Data :: binary()} ++ | {Field :: binary(), Name :: binary(), Data :: binary()}. +``` diff --git a/gex_httpd/include/http.hrl b/gex_httpd/include/http.hrl new file mode 100644 index 0000000..27d24d2 --- /dev/null +++ b/gex_httpd/include/http.hrl @@ -0,0 +1,25 @@ +-record(request, + {method = undefined :: undefined | method(), + path = undefined :: undefined | binary(), + qargs = undefined :: undefined | #{Key :: binary() := Value :: binary()}, + fragment = undefined :: undefined | none | binary(), + version = undefined :: undefined | http10 | http11 | http20, + headers = undefined :: undefined | [{Key :: binary(), Value :: binary()}], + cookies = undefined :: undefined | #{Key :: binary() := Value :: binary()}, + enctype = undefined :: undefined | none | urlencoded | multipart(), + size = undefined :: undefined | none | non_neg_integer(), + body = undefined :: undefined | none | body()}). + +-record(response, + {type = page :: page | {data, string()}, + version = http11 :: http11, + code = 200 :: pos_integer(), + slogan = "" :: string(), + headers = [] :: [{Key :: string(), Value :: iolist()}], + body = "" :: iolist()}). + +-type method() :: get | post | options. +-type multipart() :: {multipart, Boundary :: binary()}. +-type body() :: {partial, binary()} | {multipart, [body_part()]} | binary(). +-type body_part() :: {Field :: binary(), Data :: binary()} + | {Field :: binary(), Name :: binary(), Data :: binary()}.