How do I set the HTTP User-Agent when using Search::Elasticsearch?
You can pass arguments to the handle
constructor using handle_args
. So for the default HTTP::Tiny
you would use agent
:
my $es = Search::Elasticsearch->new( cxn_pool => 'Static::NoPing', nodes => 'api.metacpan.org:80', handle_args => { agent => "youragent/0.1" },);