[![Build Status](https://travis-ci.org/reneeb/HTTP-Tiny-Multipart.svg?branch=master)](https://travis-ci.org/reneeb/HTTP-Tiny-Multipart)
[![Kwalitee status](http://cpants.cpanauthors.org/dist/HTTP-Tiny-Multipart.png)](http://cpants.charsbar.org/dist/overview/HTTP-Tiny-Multipart)
[![GitHub issues](https://img.shields.io/github/issues/reneeb/HTTP-Tiny-Multipart.svg)](https://github.com/reneeb/HTTP-Tiny-Multipart/issues)
# NAME
HTTP::Tiny::Multipart - Add post\_multipart to HTTP::Tiny
# VERSION
version 0.08
# SYNOPSIS
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.1
Content-Length: 104
User-Agent: HTTP-Tiny/0.025
Content-Type: multipart/form-data; boundary=go7DX
Connection: close
Host: localhost:3000
--go7DX
Content-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.1
Content-Length: 104
User-Agent: HTTP-Tiny/0.025
Content-Type: multipart/form-data; boundary=go7DX
Connection: close
Host: localhost:3000
--go7DX
Content-Disposition: form-data; name="file"; filename="test.txt"
Content-Type: text/plain
This is a test
--go7DX
Content-Disposition: form-data; name="testfield"
test
--go7DX--
# CONTRIBUTORS
- Stephen Thirlwall
- Markvy
- Infinoid
- Mohammad S Anwar
## Development
The distribution is contained in a Git repository, so simply clone the
repository
```
$ git clone http://github.com/reneeb/HTTP-Tiny-Multipart.git
```
and change into the newly-created directory.
```
$ cd HTTP-Tiny-Multipart
```
The project uses [`Dist::Zilla`](https://metacpan.org/pod/Dist::Zilla) to
build the distribution, hence this will need to be installed before
continuing:
```
$ cpanm Dist::Zilla
```
To install the required prequisite packages, run the following set of
commands:
```
$ dzil authordeps --missing | cpanm
$ dzil listdeps --author --missing | cpanm
```
The distribution can be tested like so:
```
$ dzil test
```
To run the full set of tests (including author and release-process tests),
add the `--author` and `--release` options:
```
$ dzil test --author --release
```
# AUTHOR
Renee Baecker <reneeb@cpan.org>
# 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)