Главная страница


ru.cgi.perl

 
 - RU.CGI.PERL ------------------------------------------------------------------
 From : Alexander Averbuh                    2:4625/69.123  11 Oct 2001  18:43:00
 To : Victor Lazarchuk
 Subject : Error 302
 -------------------------------------------------------------------------------- 
 
                                                                      і   АДЩ ДБ
 Hello, Victor! Как поживает твой hерц?
 
 Четверг Октябрь 11 2001 00:08, Victor Lazarchuk wrote to All:
 
  VL> use LWP::UserAgent;
  VL> use HTTP::Request::Common;
 
  VL> $ua = new LWP::UserAgent;
  VL> $response = $ua->request(POST 'http://www.host.com/script.php3',
  VL>                               [param1=>'1',param2=>'2',param3=>'3']);
 
  VL> if ($response->is_success) {
  VL>     print $response->content;
  VL> } else {
  VL>     print $response->error_as_HTML;
  VL> }
 
 Я делаю это вот так:
 # Create a user agent object
 use LWP::UserAgent;
 $ua = new LWP::UserAgent;
 
 $ua->agent("AgentName/0.1 " . $ua->agent);
 
 # Create a request
 # Зфхёь чрфрхтёя URL ъ CGI-яЁшыюцхэшю, юсЁрсртытрющхьу чряЁюё
 my $req = new HTTP::Request POST =>
 'http://localhost/forum/cgi-bin/sendreg.pl';
 
 $req->content_type('application/x-www-form-urlencoded');
 $req->content('email=test@com.ua');    # чфхёь яхЁхфрхтёя ётЁюър
 $req->ярЁрьхтЁют
 
                                        # т ётрэфрЁтэюь фюЁьртх
 
 # Pass request to the user agent and get a response back
 my $res = $ua->request($req);
 
 # Check the outcome of the response
 if ($res->is_success) {
     print $res->content;
 } else {
     print "Bad luck this time\n";
 }
 
 Пример из perldoc, кстати.
 
   С уважением, Alexander
 
 Так, идите мыть руки, Victor!
 
 E-mail, SMS: alexaver@svitonline.com          http://alhome.virtualave.net
                                               http://haverim.virtualave.net
 
 > Если ты будешь бройгес, я тебе сделаю такой цурыс, что ты всю жизнь будешь
 > иметь нахес, надевать тфилин и носить цицис!
 
 --- GoldED 2.50+
  * Origin: Горшок - это филиал унитаза. (2:4625/69.123)
 
 

Вернуться к списку тем, сортированных по: возрастание даты  уменьшение даты  тема  автор 

 Тема:    Автор:    Дата:  
 Error 302   Victor Lazarchuk   11 Oct 2001 01:08:55 
 Re: Error 302   Eugene Grosbein   11 Oct 2001 12:50:55 
 Error 302   Alexander Averbuh   11 Oct 2001 18:43:00 
 Re: Error 302   Artem Chuprina   25 Oct 2001 18:04:50 
 Re: Error 302   Victor Lazarchuk   28 Oct 2001 00:23:26 
 Re: Error 302   Lesnichenko Konstantin   29 Oct 2001 07:07:28 
 Re: Error 302   Artem Chuprina   29 Oct 2001 16:07:54 
Архивное /ru.cgi.perl/39713bc5f6b6.html, оценка 2 из 5, голосов 10
Яндекс.Метрика
Valid HTML 4.01 Transitional