# The line you already have, but I renamed the var. my $response = $ua->request($req); #print $response->content(); # Prints the content. print $response->as_string(); # Prints the header and the content.