Hi list,
I am developing a perl script to check the status of a database.
The Scenario:
I have a
http://<webserver>/xxx/login page where I enter the username, password and the schema information and then, when a button âloginâ is pressed, it takes us to one more page
http://<webserver>/xxx/main where I need to select a DB and then, click âGOâ button and this is where I can start doing many things inside the database.
If the DB is down, we get a message âDOWN DBâ or else, we have a message âsucccessâ. I want to use these return string from the web server in my perl script and check the status.
All the above can be achieved by passing the below string in the browser (where the username, password and the schema is for the fields in the âloginâ page and the contextid specifies the database which has to be selected in the âmainâ page) ...
http://<webserver>/xxx/main?USE_CASE=GO&schema=TEST&contextid=TEST&userna me=xyz&password=aaa
When the above string is given in the browser, it works and takes me to the page that I need if the DB is up and running.
But when I use the POST command (after connecting to the web server) in the perl script, I get â302 Moved Temporarily...error. This is my POST command
POST /xxx/main HTTP/1.0
Content-Length: 64
Content-Type: application/x-www-form-urlencoded
USE_CASE=GO&schema=TEST&contextid=TEST&username=xy z&password=aaa
And the response is:
HTTP/1.0 302 Moved Temporarily
Date: Tue, 23 Aug 2005 11:39:12 GMT
Server: Rational_Web_Platform/1.0 (Win32) mod_jk/1.2.0
Set-Cookie: cqweb_session=hovbuWERz4GF@F2jlBUh4zDZEaW119p;Path =/cqweb
Set-Cookie: JSESSIONID=2C8EF55F0CB06682DD2CB40CD3017BC6;Path=/cqweb
Location:
http://localhost/xxx/main?null
Content-Length: 0
Connection: close
Content-Type: text/html; charset=UTF-8
I am not sure what I missed, any help would be highly appreciated as this is very critical my work.
This is a Apache-Tomcat web server.
Thanks a ton