>Greetings, I am attempting to reconstruct a post (using WWW::Mechanize and LWP::UserAgent so far) in order to upload a file and navigating some things I'm unfamiliar with. All my reading into examples has led me to the following code. I've truncated to the relevant section. I am having no issues with my first request to Authenticate and populate my $auth_key value with a previous request.
#!/usr/bin/perl -w
use strict;
use IO::Socket::SSL qw();
use LWP::UserAgent;
my $url_fw_upload='https://xxx.xxx.xxx.xxx/local/fwLoad?X-Progress-ID=
+xxxxxxxxxxxxx';
my $ua=LWP::UserAgent->new(ssl_opts => {
SSL_verify_mode => IO::Socket::SSL::SSL_VERIFY_NONE,
verify_hostname => 0,
});
$response=$ua->post($url_fw_upload,
Authorization=>"Bearer $auth_key",
Content_Type=>'form-data',
Content => [
"file" =>['firmware.img' => '/home/user/firmware.img'],
],
);
So the thing which is new to me is "fwLoad?X-Progress-ID", which is a Javascript generated UUID for file upload progress. I've used the same UUID that I grabbed from a browser debug session, within that browser debug I also have after the Request headers and before the Request Payload "Query String Parameters" with "X-Progress-ID: xxxxxxxxxxxxx". Since I have no Javascript capability here I'm trying to get around this and not sure if I even can without full Javascript functionality.
The results are always the same, 400 bad request. Any suggestions to point me in the right direction would be welcome as I've come up blank in my searches so far.