CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
$UA->GET gives invalid header

 



THX
Novice

Jun 20, 2010, 8:30 AM

Post #1 of 6 (1310 views)
$UA->GET gives invalid header Can't Post

Hello,

i am trying to make a GET request on a webpage, using the following code:


Code
my $dump = $ua->get('http://www.foo.bar/Foo_Bar.asp', ['idx' => $RIDX, 'ID' => $ID, 'Target' => 'Mem']);


When i make the request i only get "<h1>Bad Request (Invalid Header Name)</h1>" back. Anyone has any idea why?

Thx.


shawnhcorey
Enthusiast


Jun 20, 2010, 9:36 AM

Post #2 of 6 (1303 views)
Re: [THX] $UA->GET gives invalid header [In reply to] Can't Post

Remove the square brackets:

Code
my $dump = $ua->get('http://www.foo.bar/Foo_Bar.asp', 'idx' => $RIDX, 'ID' => $ID, 'Target' => 'Mem' );


__END__

I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".


THX
Novice

Jun 20, 2010, 9:44 AM

Post #3 of 6 (1300 views)
Re: [shawnhcorey] $UA->GET gives invalid header [In reply to] Can't Post

Problem is that when i do it without the brackets it gives me

alert("Please fill in all fields");

I am 100% sure that the idx, ID and Target are the only forms i should be sending. Because when i do it from my browser it works perfectly fine. Just in Perl it doesn't work.


(This post was edited by THX on Jun 21, 2010, 2:55 AM)


shawnhcorey
Enthusiast


Jun 20, 2010, 11:27 AM

Post #4 of 6 (1291 views)
Re: [THX] $UA->GET gives invalid header [In reply to] Can't Post


In Reply To
Problem is that when i do it without the brackets it gives me

alert("Please fill in all fields");

I am 100% sure that the idx, ID and Target are the only forms i should be sending. Because when i do it from my browser it works perfectly fine. Just in Perl it doesn't work.

Also the sites u gave me are down for me, like a lot of other sites. I think there's a big routing problem somewhere.


That message is being returned by "Foo_Bar.asp" Since I don't know what it is, I can't tell you what is missing. Also, it looks like Javascript, not something you would expect back from a normal HTTP request. As such, I would look through any Javascript files the site may run in case one of them sets a field in them.

__END__

I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at perldoc.perl.org. The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".


THX
Novice

Jun 20, 2010, 11:45 AM

Post #5 of 6 (1290 views)
Re: [shawnhcorey] $UA->GET gives invalid header [In reply to] Can't Post


In Reply To

In Reply To
Problem is that when i do it without the brackets it gives me

alert("Please fill in all fields");

I am 100% sure that the idx, ID and Target are the only forms i should be sending. Because when i do it from my browser it works perfectly fine. Just in Perl it doesn't work.

Also the sites u gave me are down for me, like a lot of other sites. I think there's a big routing problem somewhere.


That message is being returned by "Foo_Bar.asp" Since I don't know what it is, I can't tell you what is missing. Also, it looks like Javascript, not something you would expect back from a normal HTTP request. As such, I would look through any Javascript files the site may run in case one of them sets a field in them.


The ASP script basically checks if all the values are filled in, if they are not, it will give u a warning message with Javascript, the one i showed u in the previous post. And i'm 100% sure the fields i put there are the only ones who need to be filled in. This makes me think something is wrong with the GET request.


THX
Novice

Jun 21, 2010, 12:07 PM

Post #6 of 6 (1274 views)
Re: [THX] $UA->GET gives invalid header [In reply to] Can't Post

Small bump, anyone? :-)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives