- or download this
#!/usr/bin/perl
use strict;
...
$ perl restClient.pl
$VAR1 = 'Not a SCALAR reference at /usr/local/share/perl/5.22.1/LWP/Pr
+otocol/http.pm line 260.
';
- or download this
package ClientRest;
...
}
1;
- or download this
$ curl -u user:password -H "Content-Type: multipart/form-data" -H "Acc
+ept: application/json" -H "Expect:" -F file=@test.txt -X POST http://
+127.0.0.1:8000/upload/ | jq '.'
% Total % Received % Xferd Average Speed Time Time Time
+ Current
...
"language": "perl",
"style": "emacs"
}
- or download this
$ perl restClient.pl
$VAR1 = 'Not a SCALAR reference at /usr/local/share/perl/5.22.1/LWP/Pr
+otocol/http.pm line 260.
';
- or download this
else {
# Set (or override) Content-Length header
...
hlist_remove(\@h, 'Content-Length');
}
}
- or download this
my $headers = { "Content" => ['file' => [$options{file}]],
"Content-type" => 'multipart/form-data',
"Authorization" => 'Basic ' .
encode_base64($options{username} . ':' . $options{password
+}) };
- or download this
# module part
sub postSnippets {
...
'url' => 'http://127.0.0.1:8000/snippets/2/',
'owner' => 'user'
};
- or download this
$VAR1 = '{"detail":"Multipart form parse error - Invalid boundary in m
+ultipart: None"}';
- or download this
sub postSnippetsFile {
my ( $self, %options ) = @_;
...
$headers );
return $self->{_client}->responseContent();
}