Re: newbie using POST
Rafael A Calvo (rafa+@cs.cmu.edu)
Mon, 15 Mar 1999 10:33:50 -0500 (EST)
Hi,
I found the bug.
Thanks anyway.
Rafa
On Fri, 12 Mar 1999, Rafael A Calvo wrote:
You:>>
You:>>Hi,
You:>>
You:>>I'm using the following code (almost the example in lwpcook)
You:>>
You:>>--------------------------------------
You:>>use LWP::UserAgent;
You:>>$ua = new LWP::UserAgent;
You:>>...
You:>>my $req = new HTTP::Request
You:>>'POST','http://myserver/cgi-bin/kNN_demo.pl';
You:>>$req->content_type('application/x-www-form-urlencoded');
You:>>$req->content("DataBase=$DataBase&Title=$title&Abstract=$Abstract&OptionK=$K&OptionN=$N");
You:>>my $res = $ua->request($req);
You:>>print $res->content;
You:>>---------------------------------------
You:>>
You:>>The HTML ouput seems ok, but when I run it from the browser it says
You:>>
You:>>-------------------
You:>>"malformed header from script. Bad
You:>>header=:/usr4/rafa/public_html/cgi-bin/post.pl"
You:>>--------------------
You:>>the output was:
You:>>-------------------------
You:>><HTML>
You:>><HEAD><TITLE>kNN on </TITLE></HEAD>
You:>><BODY BGCOLOR="#ffffff">
You:>><center><img src="http://www.cs.cmu.edu/~rafa/ir/resources/lti_logo.gif"
You:>>width="95" height="98"></center><CENTER><H1>kNN (k-Nearest-Neighbours) on
You:>></H1></CENTER>
You:>><H3>Your query:</H3><DL COMPACT><DT><I>Title: </I><DD><DT><I>Abstract:
You:>></I><DD>
You:>><DT><I>Keywords: </I><DD></DL><TABLE BORDER=4 CELLSPACING=2 CELLPADDING=2
You:>>WIDTH
You:>>="80%"><CAPTION><B>KNN Results: Top 0
You:>>Categories</B></CAPTION><TR><TH>Ranking</T
You:>>H><TH>Category Name</TH><TH>Weighting</TH></TR></BORDER></TABLE><br><br><A
You:>>HREF="mailto:rafa@cs.cmu.edu">rafa@cs.cmu.edu</A>
You:>></BODY>
You:>></HTML>
You:>>---------------------------
You:>>
You:>>What am I doing wrong?
You:>>cheers,
You:>>
You:>>Rafael
You:>>
You:>>
You:>>------------------------------------------------------------------------------
You:>>office: +1 412 268-2088 : Fax:+1 412 268-6298 : Home: +1 412 361-3698
You:>>http://www.cs.cmu.edu/~rafa
You:>>
You:>>
You:>>
------------------------------------------------------------------------------
office: +1 412 268-2088 : Fax:+1 412 268-6298 : Home: +1 412 361-3698
http://www.cs.cmu.edu/~rafa