HTTP::Tiny::Multipart3pm
Add post_multipart to http::tiny
Usage
use HTTP::Tiny;use HTTP::Tiny::Multipart;my $http = HTTP::Tiny->new;my $content = "This is a test";my $response = $http->post_multipart( 'http://localhost:3000/', {file => {filename => 'test.txt',content => $content,}} );
creates this request
POST / HTTP/1.1Content-Length: 104User-Agent: HTTP-Tiny/0.025Content-Type: multipart/form-data; boundary=go7DXConnection: closeHost: localhost:3000--go7DXContent-Disposition: form-data; name="file"; filename="test.txt"This is a test--go7DX--
And
use HTTP::Tiny;use HTTP::Tiny::Multipart;my $http = HTTP::Tiny->new;my $content = "This is a test";my $response = $http->post_multipart( 'http://localhost:3000/', {file => {filename => 'test.txt',content => $content,content_type => 'text/plain',},testfield => 'test'} );
creates
POST / HTTP/1.1Content-Length: 104User-Agent: HTTP-Tiny/0.025Content-Type: multipart/form-data; boundary=go7DXConnection: closeHost: localhost:3000--go7DXContent-Disposition: form-data; name="file"; filename="test.txt"Content-Type: text/plainThis is a test--go7DXContent-Disposition: form-data; name="testfield"test--go7DX--
Version
version 0.08
Contributors
•
|
Stephen Thirlwall |
|---|---|
•
|
Markvy |
•
|
Infinoid |
•
|
Mohammad S Anwar |
Copyright and license
This software is Copyright (c) 2018 by Renee Baecker.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)
Releases
4 releases since Debian 10 (Buster); the text changed 2 times.