mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-07-27 11:46:44 +00:00
add correct parameters to PUT requests
This commit is contained in:
parent
c0659a7379
commit
dde4dfb972
@ -98,7 +98,15 @@ sub call {
|
||||
} elsif ($method eq 'POST') {
|
||||
$response = $ua->request(HTTP::Request::Common::POST($uri, Content => $param));
|
||||
} elsif ($method eq 'PUT') {
|
||||
$response = $ua->request(HTTP::Request::Common::PUT($uri, Content => $param));
|
||||
# We use another temporary URI object to format
|
||||
# the application/x-www-form-urlencoded content.
|
||||
|
||||
my $tmpurl = URI->new('http:');
|
||||
$tmpurl->query_form(%$param);
|
||||
my $content = $tmpurl->query;
|
||||
|
||||
$response = $ua->request(HTTP::Request::Common::PUT($uri, 'Content-Type' => 'application/x-www-form-urlencoded', Content => $content));
|
||||
|
||||
} elsif ($method eq 'DELETE') {
|
||||
$response = $ua->request(HTTP::Request::Common::DELETE($uri));
|
||||
} else {
|
||||
@ -107,7 +115,7 @@ sub call {
|
||||
|
||||
#print "RESP: " . Dumper($response) . "\n";
|
||||
|
||||
my $ct = $response->header('Content-Type');
|
||||
my $ct = $response->header('Content-Type') || '';
|
||||
|
||||
if ($response->is_success) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user