Fix schema typo + config, dialyzer stuff, add some events
This commit is contained in:
+9
-9
@@ -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).
|
||||
|
||||
%% ======================================================================
|
||||
|
||||
|
||||
Reference in New Issue
Block a user