in reply to HTTP::Request::Common : Specify POST fields separators ?

You need to learn your HTTP terminology
#!/usr/bin/perl -- use strict; use warnings; use HTTP::Request::Common qw' POST '; my %params= ('page' => 28, 'index' => 36); print POST('http://example.org', \%params)->as_string,"\n\n"; print POST('http://example.org', { %params , qw' Content-Type form-dat +a ', } )->as_string; __END__ POST http://example.org Content-Length: 16 Content-Type: application/x-www-form-urlencoded index=36&page=28 POST http://example.org Content-Length: 39 Content-Type: application/x-www-form-urlencoded index=36&page=28&Content-Type=form-data
The purpose of WWW::Mechanize is to avoid having to bother with these details.

Replies are listed 'Best First'.
Re^2: HTTP::Request::Common : Specify POST fields separators ?
by Anonymous Monk on Jan 05, 2010 at 08:18 UTC
    You got confused there, headers come after params
    #!/usr/bin/perl -- use strict; use warnings; use HTTP::Request::Common qw' POST '; my %params= ('page' => 28, 'index' => 36); print POST('http://example.org', \%params , qw' Content-Type form-data + ', )->as_string; __END__ POST http://example.org Content-Length: 132 Content-Type: multipart/form-data; boundary=xYzZY --xYzZY Content-Disposition: form-data; name="index" 36 --xYzZY Content-Disposition: form-data; name="page" 28 --xYzZY--
    That still doesn't help the OP with his custom protocol