|
Perl Http запрос из перл файла
|
|||
---|---|---|---|
#18+
Всем привет! Народ, посоветуйте как cgi-скрипт запустить. Вот кусок кода: ------------------------------------------------ my $request = new HTTP::Request 'GET' => $url; $request->header('Accept' => 'text/html'); my $result = $ua->request($request); if ($result->is_success) { ------------------------------------------------ вылетает с ошибкой Status :: http://localhost:8080/dynaweb/Sites/new/siteMap.jsp?site_id=4&version_id=15 was not detected! An Error Occurred 500 Can't connect to localhost:8080 (Bad protocol 'tcp') url: http://localhost:8080/dynaweb/Sites/new/home_text.jsp?site_id=4&version_id=15 ------------------------------------------------ такой же скрипт из командной строки работает без проблем. В чем может быть ошибка? P.S. в cgi пришлось закоментировать #use strict; иначе скрипт ваще отказывался работать. ... |
|||
:
Нравится:
Не нравится:
|
|||
06.07.2004, 17:42 |
|
Perl Http запрос из перл файла
|
|||
---|---|---|---|
#18+
Перефразирую вопрос. Вот скрипт который я запускаю на "Tomcat 5.0" ------------------------------------------------------------ #!c:\Perl\bin\perl.exe print "Content-type: text/html\n\n"; print "test 1 !!!!!!!!!!!!!!! <BR>\n"; require LWP::UserAgent; print "test 2 !!!!!!!!!!!!!!! <BR>\n"; my $ua = LWP::UserAgent->new(env_proxy => 1,keep_alive => 1,timeout => 30); print "test 3 !!!!!!!!!!!!!!! <BR>\n"; $response = $ua->get(''); $request = HTTP::Request->new('GET', 'http://www.google.com'); print "test 4 !!!!!!!!!!!!!!! <BR>\n"; $response = $ua->request($request); print "test 5 !!!!!!!!!!!!!!! <BR>\n"; if ($response->is_success) { print $response->content; } else { print $response->error_as_HTML; } print "<BR> test 1000 !!!!!!!!!!!!!!! <BR>\n"; ------------------------------------------------------------ вот ответ сервера ------------------------------------------------------------ test 1 !!!!!!!!!!!!!!! test 2 !!!!!!!!!!!!!!! test 3 !!!!!!!!!!!!!!! test 4 !!!!!!!!!!!!!!! test 5 !!!!!!!!!!!!!!! An Error Occurred 500 Can't connect to www.google.com:80 (Bad protocol 'tcp') test 1000 !!!!!!!!!!!!!!! ------------------------------------------------------------ В чем проблема? ... |
|||
:
Нравится:
Не нравится:
|
|||
07.07.2004, 11:52 |
|
|
start [/forum/topic.php?fid=23&msg=32592980&tid=1479613]: |
0ms |
get settings: |
9ms |
get forum list: |
13ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
150ms |
get topic data: |
14ms |
get forum data: |
3ms |
get page messages: |
42ms |
get tp. blocked users: |
2ms |
others: | 13ms |
total: | 252ms |
0 / 0 |