in reply to LWP::Useragent - File Upload
Try using just Content_Type => 'form-data' or Content_Type => 'multipart/form-data; boundary="xYzZY"'
poj#!/usr/bin/perl use strict; use warnings; use MIME::Base64; use HTTP::Request::Common; my $file = "/tmp/test_image.tgz.bin"; my $url = "https://10.248.179.31/api/rest/software_package"; my $request = HTTP::Request::Common::POST( $url, Authorization => 'Basic ' . encode_base64('user:password'), Content_Type => 'multipart/form-data; boundary="xYzZY"', Content => [ file => [$file] ], ); print $request->as_string;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: LWP::Useragent - File Upload
by leefp (Initiate) on Dec 20, 2018 at 19:51 UTC | |
by poj (Abbot) on Dec 20, 2018 at 20:24 UTC | |
by Anonymous Monk on Jun 23, 2020 at 13:02 UTC | |
by choroba (Cardinal) on Jun 23, 2020 at 14:39 UTC | |
by jdporter (Paladin) on Jun 24, 2020 at 14:19 UTC | |
by yourself (Novice) on Feb 03, 2021 at 03:22 UTC |