Fix schema typo + config, dialyzer stuff, add some events

This commit is contained in:
Ulf Wiger
2025-05-14 15:03:12 +02:00
parent c57d89ba3d
commit 0dca4bfaf8
9 changed files with 27 additions and 21 deletions
+9 -9
View File
@@ -57,9 +57,9 @@ request(get, URL, []) ->
HttpOpts = [{timeout, 15000}],
Opts = [],
Profile = default,
request_result(httpc:request(get, {URL, Headers}, HttpOpts, Opts, Profile));
request(post, URL, Body) ->
post_request(URL, Body).
request_result(httpc:request(get, {URL, Headers}, HttpOpts, Opts, Profile)).
%% request(post, URL, Body) ->
%% post_request(URL, Body).
expand_url(URL) ->
case re:run(URL, <<"{[^}]+}">>, []) of
@@ -122,12 +122,12 @@ get_var_name(<<H, T/binary>>, Acc) ->
%% From gmplugin_web_demo_handler.erl ===================================
post_request(URL, Map) ->
?LOG_DEBUG("Map = ~p", [Map]),
Body = json:encode(Map),
?LOG_DEBUG("Body = ~s", [Body]),
PostRes = httpc:request(post, {URL, [], "application/json", Body}, [], []),
request_result(PostRes).
%% post_request(URL, Map) ->
%% ?LOG_DEBUG("Map = ~p", [Map]),
%% Body = json:encode(Map),
%% ?LOG_DEBUG("Body = ~s", [Body]),
%% PostRes = httpc:request(post, {URL, [], "application/json", Body}, [], []),
%% request_result(PostRes).
%% ======================================================================