I'm trying to connect to a server with LWP::UserAgent. I have succeeded to do anonymous searches with LWP::UserAgent on that same server, but now I have to "secret" stuff and that requires to use authentication on that server. I have used the code:
my $ua = LWP::UserAgent->new;
$ua->default_header('Content-Type' => "application/x-www-form-urlencoded");
$ua->default_header('Authorization' => "Basic ".$Authent);
my $resp = $ua->post($uri);
The server reponds: error 400, Required param: grant_type
So, how do I set the grand type parameter with LWP? I have not found any page concerning the grand type problem.
I have tried also:
$ua->default_header('grant_type' => "client_credentials");
and
my $resp = $ua->post($uri, grant_type => "client_credentials");
All three gives exactly the same error message. I have no idea how to get things work.