Current section

Files

Jump to
m_http src t.erl
Raw

src/t.erl

-module(t).
-compile({parse_transform, category}).
-export([t/0]).
t() ->
[m_http ||
Access /= cats:get(<<"API_ACCESS_KEY">>),
Secret /= cats:get(<<"API_SECRET_KEY">>),
_ > "POST https://api.assay.it/oauth2/token",
_ > "Content-Type: application/x-www-form-urlencoded",
_ > #{
grant_type => password,
username => Access,
password => Secret
},
_ < 200,
_ < lens:at(<<"access_token">>)
].
% _ > #{
% grant_type => password,
% username => cats:config(<<"API_ACCESS_KEY">>),
% password => cats:config(<<"API_SECRET_KEY">>)
% }