Schrift
[thread]11460[/thread]

Regex matched nicht (Seite 2)

Tags: Ähnliche Threads

Leser: 2


<< |< 1 2 3 >| >> 25 Einträge, 3 Seiten
FlorianL
 2008-03-14 11:15
#107031 #107031
User since
2007-05-18
142 Artikel
BenutzerIn
[default_avatar]
Okay das habe ich verstanden, das heisst die Abfrage funktioniert eigentlich aber das lwp error handling erkennt 302 als fehler und bringt ERROR: ?

Oder versteh ich das falsch:


The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.

The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).

If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.

Note: RFC 1945 and RFC 2068 specify that the client is not allowed
to change the method on the redirected request. However, most
existing user agent implementations treat 302 as if it were a 303
response, performing a GET on the Location field-value regardless
of the original request method. The status codes 303 and 307 have
been added for servers that wish to make unambiguously clear which
kind of reaction is expected of the client.



Was anderes zum Poard:

Er zeigt gerad im Index 2 Seiten an, allerdings ist auf seite 2 kein posting, nur ein leeres Textfeld... Wird sich mit diesem Posting sicher ändern aber ich wollts ma gesagt ham :)
FlorianL
 2008-03-14 11:17
#107032 #107032
User since
2007-05-18
142 Artikel
BenutzerIn
[default_avatar]
Wenn ich dein Script ausführe bekomm ich ne Fehlermeldung aus der Message.pm:

xadmp01 # perl test.pl
Can't call method "clone" on unblessed reference at /usr/opt/perl5/lib/site_perl/5.8.2/HTTP/Message.pm line 53.


Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
xadmp01 # perl -V 
Summary of my perl5 (revision 5.0 version 8 subversion 2) configuration:
Platform:
osname=aix, osvers=5.2.0.0, archname=aix-thread-multi
uname='aix animals 2 5 000709cf4c00 '
config_args=''
hint=previous, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='cc_r', ccflags ='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 \
-D_LARGE_FILES -qlonglong',
optimize='-O',
cppflags='-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -D_ALL_SOURCE \
-D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES \
-qlonglong -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES \
-qlonglong -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias \
-DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong -D_ALL_SOURCE \
-D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong \
-D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT \
-q32 -D_LARGE_FILES -qlonglong -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=16384 -qnoansialias -DUSE_NATIVE_DLOPEN \
-DNEED_PTHREAD_INIT -q32 -D_LARGE_FILES -qlonglong'
ccversion='5.0.2.0', gccversion='', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='ld', ldflags =' -brtl -b32 -bmaxdata:0x80000000'
libpth=/lib /usr/lib /usr/ccs/lib
libs=-lbind -lnsl -ldbm -ldl -lld -lm -lpthreads -lc_r -lcrypt -lbsd -lPW
perllibs=-lbind -lnsl -ldl -lld -lm -lpthreads -lc_r -lcrypt -lbsd -lPW
libc=/lib/libc.a, so=a, useshrplib=true, libperl=libperl.a
gnulibc_version=''
Dynamic Linking:
dlsrc=dl_aix.xs, dlext=so, d_dlsymun=undef, ccdlflags='-bE:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp \
-bE:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp \
-bE:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp -bE:/usr/opt/perl5/lib/5.8.2/aix-thread-multi/CORE/perl.exp'
cccdlflags=' ', lddlflags='-bhalt:4 -bM:SRE -bI:$(PERL_INC)/perl.exp -bE:$(BASEEXT).exp -bnoentry -lpthreads -lc_r'


Characteristics of this binary (from libperl):
Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
Locally applied patches:
SUIDPERLIO1 - fix PERLIO_DEBUG buffer overflow (CAN-2005-0156)
SPRINTF0 - fixes for sprintf formatting issues - CVE-2005-3962
REGCOMP0 - buffer overflow in regexp engine for UTF8 (CVE-2007-5116)
Built under aix
Compiled at Dec 5 2007 16:08:49
@INC:
/usr/opt/perl5/lib/5.8.2/aix-thread-multi
/usr/opt/perl5/lib/5.8.2
/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-multi
/usr/opt/perl5/lib/site_perl/5.8.2
/usr/opt/perl5/lib/site_perl
.
xadmp01 #
renee
 2008-03-14 11:22
#107033 #107033
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
FlorianL+2008-03-14 10:15:22--
[...]

Was anderes zum Poard:

Er zeigt gerad im Index 2 Seiten an, allerdings ist auf seite 2 kein posting, nur ein leeres Textfeld... Wird sich mit diesem Posting sicher ändern aber ich wollts ma gesagt ham :)


Ist bekannt ;-)
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
renee
 2008-03-14 11:23
#107034 #107034
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
FlorianL+2008-03-14 10:17:38--
Wenn ich dein Script ausführe bekomm ich ne Fehlermeldung aus der Message.pm:

xadmp01 # perl test.pl
Can't call method "clone" on unblessed reference at /usr/opt/perl5/lib/site_perl/5.8.2/HTTP/Message.pm line 53.

[...]


Welche Version von HTTP::Message hast Du? Evtl. mal mit einem Upgrade versuchen...
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
FlorianL
 2008-03-14 12:52
#107041 #107041
User since
2007-05-18
142 Artikel
BenutzerIn
[default_avatar]
Hab jetzt cpan und vor allem lwp auf den neuesten stand gebracht und bekome den fehler nicht mehr.

Code (perl): (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/perl

use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request;

my $req = HTTP::Request->new(
  POST => "http://www-912.ibm.com/eserver/support/fixes/fixcentral/pfixpacks/53",
  [
     tl => 'all',
  ],
);

my $proxy = 'http://suma:***@svproxsg01.***.de:8080/';

my $ua  = LWP::UserAgent->new;
$ua->timeout(10);
$ua->proxy(['http','ftp'], $proxy) if defined $proxy;


push @{ $ua->requests_redirectable }, 'POST';

my $response = $ua->request( $req );

print $response->status_line . "\n";
print $response->content . "\n";


Das lässt sich ausführen, der Output:

Code: (dl )
1
2
3
4
xadmp01 # perl test.pl 
411 Length Required

xadmp01 #


Augenscheinlich muss ich also noch Content-lenght mit angeben, aber ich find in der lwp-doc keine info ?!


Many responses contain a Content-Length line that specifies the length, in bytes, of the body. However, this line is rarely present on dynamically generated pages, and because you never know which pages are dynamically generated, you can't rely on that header line being there.

(Other, rarer header lines are used for specifying that the content has moved to a given URL, or that the server wants the browser to send HTTP cookies, and so on; however, these things are generally handled for you automatically by LWP.)
[b]
renee
 2008-03-14 13:19
#107043 #107043
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
FlorianL+2008-03-14 11:52:56--
[...]
Augenscheinlich muss ich also noch Content-lenght mit angeben, aber ich find in der lwp-doc keine info ?!
[...]


Content-length kannst Du bei CPAN:HTTP::Request angeben...

Code (perl): (dl )
1
2
3
4
5
6
7
my $req = HTTP::Request->new(
  POST => "http://www-912.ibm.com/eserver/support/fixes/fixcentral/pfixpacks/53",
  [
     tl => 'all',
  ],
  Content_Length => 5,
);
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
FlorianL
 2008-03-14 14:04
#107047 #107047
User since
2007-05-18
142 Artikel
BenutzerIn
[default_avatar]
Mahlzeit!

Der Code funzt so schonmal, allerdings bekomme ich immernoch die 'standart' site, also wird da nicht wirklich was übergeben....

Ich bin kurz davor mechanize runter zu laden und irgendwie direkt im code einzubinden... ich schätze dabei hab ich aber nen massiven code overhead
renee
 2008-03-14 14:14
#107049 #107049
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Edit: Blödsinn...
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
renee
 2008-03-14 14:18
#107050 #107050
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Schau Dir mal mit Firefox und LiveHttpHeaders an, was als Request alles geschickt wird, wenn Du das ganze manuell machst. Vielleicht fehlen ganz einfach Daten, die mitgesendet werden müssen. Oder wird ein Cookie benötigt?
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/
FlorianL
 2008-03-14 14:43
#107051 #107051
User since
2007-05-18
142 Artikel
BenutzerIn
[default_avatar]
renee+2008-03-14 13:18:50--
Schau Dir mal mit Firefox und LiveHttpHeaders an, was als Request alles geschickt wird, wenn Du das ganze manuell machst. Vielleicht fehlen ganz einfach Daten, die mitgesendet werden müssen. Oder wird ein Cookie benötigt?


wir nutzen hier den internet exploder, und ich hab mir schonmal ne schelte ageholt weil ich firefox installiert hab ^^

naja.. ich probiers mit mechanize, das is easy... aber danke dir :)
<< |< 1 2 3 >| >> 25 Einträge, 3 Seiten



View all threads created 2008-03-13 15:51.