I am writing a perl program on Unix System Services to do an HTTP request
to a distributed web server, in this case Apache running on my XP desktop.
 This is the program:

#!/usr/local/bin/perl -w

   use strict;

   use LWP::UserAgent;
   use URI::URL;
   use URI::Escape;
   use HTTP::Headers;
   use HTTP::Request;
   use Convert::IBM390;

   my $method = 'GET';
   my $urlString = "http://w90ts62265xp.jdnet.deere.com/main.php";;
   my $url = new URI::URL($urlString);
   my $req = new HTTP::Request($method, $url);

   my $ua = new LWP::UserAgent;
   $ua->timeout(5);
   my $resp = $ua->request($req);

   # Convert response to ebcdic and print it out.
   my @asciiResponse =  $resp->content;
   foreach my $aline (@asciiResponse) {
      my $bline = Convert::IBM390::asc2eb($aline);
      print ("$bline\n");
   }


When I run this, I get the following output:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>501 Method Not Implemented</title>
</head><body>
<h1>Method Not Implemented</h1>
<p>[EMAIL PROTECTED]@����a�K� to / not supported.<br />
</p>
<hr />
<address>Apache/2.0.47 (Win32) PHP/4.3.2 Server at
W90TS62265XP.jdnet.deere.com Port 80</address>
</body></html>

My Apache log shows this:

1.1.1..1 - - [09/Oct/2003:15:43:33 -0500]
"[EMAIL PROTECTED]@\xc8\xe3\xe3\xd7a\xf1K\xf1"
501 329

Which, is in hex for an ebcdic "GET main.php"

If I run this on a Linux box (without the Convert stuff of course) it comes
back fine.

Does anyone know how/where I need to convert my HTTP request into ASCII?  I
tried converting it in several different places to no avail.  

Thanks,
Tom Stewart
[EMAIL PROTECTED]


Reply via email to