use WWW::Mechanize 1.75; my %urls = ( login => "https://$option->{hostname}/storiqone-backend/api/v1/auth/", list_archive => "https://$option->{hostname}/storiqone-backend/api/v1/archive/", ); my $ua = WWW::Mechanize->new; $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return }); $ua->post( $urls{login},, content_type => 'application/json', content => $credentials, ); print $ua->content, "\n"; $ua->post( $auth_url, content_type => 'application/json', content => $urls{list_archive}, ); print $ua->content, "\n"; __END__ ... output here ...