Closed aero closed 6 years ago
I'm not sure if you really want to put this logic into pre_processor
. How about doing this instead:
my $client = OpenAPI::Client->new(...);
$client->ua->on(start => sub {
my ($ua, $tx) = @_;
$tx->req->headers->header(Authorization => ...);
});
Oh I didn't know such hooking mechanism. I succeeded in that way.
Thank you.
HI,
Nowadays, there are many services that want the header encrypted with api key like https://metacpan.org/pod/WebService::Cryptopia
Making signature with hamc_sha256(key+method+url+nonce+content) and adding it to request headers.
But OpenApi::Client's pre_process function can't see method and url, so I can't build signature and add it to headers.
How can I make this possible?