in reply to Re: Attempting to POST a file to local server
in thread Attempting to POST a file to local server

But the code in your original post already has an underscore.

  • Comment on Re^2: Attempting to POST a file to local server

Replies are listed 'Best First'.
Re^3: Attempting to POST a file to local server
by Anonymous Monk on May 11, 2017 at 08:37 UTC

    I too found the phrasing confusing but it is correct as stated

    A value of form_data (an error) is treated as "application/x-www-form-urlencoded"

    A value of form-data is treated as "multipart/form-data"

    #!/usr/bin/perl -- use strict; use warnings; use LWP; my $ua = LWP::UserAgent->new; $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return }); $ua->timeout( 0.1 ); my $res = $ua->post('http://localhost:8012/', #~ Content_Type => 'form_data', ## treated as "application/x-www-f +orm-urlencoded" Content_Type => 'form-data', ## treated as "multipart/form-data" #~ Content_Type => 'multipart/form-data', Content => [ Filedata => [ __FILE__, 'Hello.txt', Content_Type => 'text/plain', ], submit => 'Submit', ], );
Re^3: Attempting to POST a file to local server
by karlgoethebier (Abbot) on May 11, 2017 at 09:58 UTC

    BTW: Nice that you are back.

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    Furthermore I consider that Donald Trump must be impeached as soon as possible

      Thanks.

      Thats something you /msg karlgoethebier