GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
HTTP::Tiny::Multipart(3) User Contributed Perl Documentation HTTP::Tiny::Multipart(3)

HTTP::Tiny::Multipart - Add post_multipart to HTTP::Tiny

version 0.08

    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--

  • Stephen Thirlwall
  • Markvy
  • Infinoid
  • Mohammad S Anwar

Renee Baecker <reneeb@cpan.org>

This software is Copyright (c) 2018 by Renee Baecker.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)
2018-04-30 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.