|
ru.perl- RU.PERL ---------------------------------------------------------------------- From : dimka kuvshinov 2:5020/400 16 Aug 2000 11:15:25 To : All Subject : как создать запрос $req->content_type('multipart/form-data'); ??? -------------------------------------------------------------------------------- Форумщики, подскажите!!! есть: my $req = new HTTP::Request POST => 'http://www.perl.com/cgi-bin/BugGlimpse'; $req->content_type('application/x-www-form-urlencoded'); $req->content('match=www&errors=0'); согласно rfc1867 (http://www.olviko.ru/cgi-bin/showrfc.cgi?rfcno=1867): "3.2 Action on submit When the user completes the form, and selects the SUBMIT element, the browser should send the form data and the content of the selected files. The encoding type application/x-www-form-urlencoded is inefficient for sending large quantities of binary data or text containing non-ASCII characters. Thus, a new media type, multipart/form-data, is proposed as a way of efficiently sending the values associated with a filled-out form from client to server." perldoc LWP UserAgent, и пр перерыл, не знаю, одного, как правильно сформировать POST запрос. Hужно сделать нечто вроде этого, но оно, точно не работает, как формируются запросы?): #!/usr/bin/perl -wT ... обявили все нужные бибилиотеки и все прочее, что требуется. $file="/usr/local/www/data/file.gif"; my $req = new HTTP::Request POST => 'http://www.perl.com/cgi-bin/BugGlimpse'; $req->content_type('multipart/form-data'); $req->content('$file'); Спасибо за ответ, с меня пиво, если в москве. -- Отправлено через сервер Talk.Ru - http://www.talk.ru --- ifmail v.2.15dev5 * Origin: Talk.ru (2:5020/400) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.perl/648836ee14b3.html, оценка из 5, голосов 10
|