How to extract response text out of Response Header
highplainsbubba
Posts: 34
I have a html file that I am trying to use as a login page. It appears to work, I "post" the username and password to the spinneret and it returns a response header with either Sucess! or Failure. (See Below.) It splashes this across the login page and I don't quite know why. I know you can extract the response text out of an Ajax script, but I don't want to make a seperate Ajax request just for that. I would like to extract the "Sucess" from the response header of the login post, and "if response text = !Sucess (script), load the next page. I just can't see the forest for the trees. Could someone point me toward the right command to do this?
HTTP/1.1 200 OK Content-Type: text/html Server: Spinneret/2.1 Cache-Control: public Expires: Tue, 17 Jan 2001 09:53:44 GMT Sucess!
HTTP/1.1 200 OK Content-Type: text/html Server: Spinneret/2.1 Cache-Control: public Expires: Tue, 17 Jan 2001 09:53:44 GMT Sucess!
<html> <head> <title>Sanity Ridge Ranch</title> <form id="post" name="post" method="post"> Username: <input type="text" name="user" /> <br /> Password: <input type="password" name="password" /> <br /> <input type="Submit" value="Log On" /> </form> <br /> </head> <body> <div style="width:720px;margin:auto;"> <h1 style="text-align:center;color:blue;">Sanity Ridge Ranch Log In Page</h1> <br /> <br /> </body> </html>
Comments
The string "Success!" is not a valid header name or value. As a matter of fact "Success!" is part of the message body. Therefore, the string is displayed by the browser.
There are plenty of other newbies (e.g., myself) out here who are benefiting from these questions and answers. Keep 'em coming.
There is a bit more that goes along with authentication like keeping the authentication token while clicking around on the site.