fix(log): fix web hook print error
This commit is contained in:
parent
1ef51cae1d
commit
98c62df2e4
|
@ -325,7 +325,7 @@ send_http_request(ClientID, Params) ->
|
|||
{ok, Path} = application:get_env(?APP, path),
|
||||
Headers = application:get_env(?APP, headers, []),
|
||||
Body = emqx_json:encode(Params),
|
||||
?LOG(debug, "Send to: ~0p, params: ~0s", [Path, Body]),
|
||||
?LOG(debug, "Send to: ~0p, params: ~s", [Path, Body]),
|
||||
case ehttpc:request(ehttpc_pool:pick_worker(?APP, ClientID), post, {Path, Headers, Body}) of
|
||||
{ok, StatusCode, _} when StatusCode >= 200 andalso StatusCode < 300 ->
|
||||
ok;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
-export([start_link/0]).
|
||||
-export([get_received_data/0]).
|
||||
-export([stop/1]).
|
||||
-export([code_change/3, handle_call/3, handle_cast/2, handle_info/2, init/1, terminate/2]).
|
||||
-export([code_change/3, handle_call/3, handle_cast/2, handle_info/2, init/1, init/2, terminate/2]).
|
||||
-define(HTTP_PORT, 9999).
|
||||
-define(HTTPS_PORT, 8888).
|
||||
-record(state, {}).
|
||||
|
@ -102,4 +102,4 @@ init(Req, State) ->
|
|||
reply(Req, ok) ->
|
||||
cowboy_req:reply(200, #{<<"content-type">> => <<"text/plain">>}, <<"ok">>, Req);
|
||||
reply(Req, error) ->
|
||||
cowboy_req:reply(404, #{<<"content-type">> => <<"text/plain">>}, <<"deny">>, Req).
|
||||
cowboy_req:reply(404, #{<<"content-type">> => <<"text/plain">>}, <<"deny">>, Req).
|
||||
|
|
Loading…
Reference in New Issue