Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

HTTP::Tiny::Multipart

Name HTTP::Tiny::Multipart
Version 0.08
Located at /usr/share/perl5
File /usr/share/perl5/HTTP/Tiny/Multipart.pm
Is Core No
Search CPAN for this module HTTP::Tiny::Multipart
Documentation HTTP::Tiny::Multipart
Module Details HTTP::Tiny::Multipart


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


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)

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026