Checking response from a web page


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Checking response from a web page
# 1  
Old 12-11-2009
Checking response from a web page

wget --spider --user=xxxx --password=xxxx "http://xxx.xxxx.com" > /dev/null 2>&1;

I am using the above command in if loop to check the response of the page without downloading the page. I just want to check whether the page is up and running. But when i execute the command i am getting

HTTP request sent, awaiting response... 500 Internal Server Error
10:37:02 ERROR 500: Internal Server Error

can someone tell me why i am getting the error.
# 2  
Old 12-11-2009
Not much to go on

You're trying to login so I realize you can't provide much detail but we don't know whether the page requires GET or POST method. The first method, GET, puts the information you supply into the URL. The second method, POST, puts the information into the header of the HTTP request.

If there's a login form on the web page you can look at the source HTML, find the form, see what method it uses, and what page it calls. Somewhere in the HTML something like the below code can be found unless there is also some crazy JavaScript going on.

Code:
<form method="POST" action="security_check">
<input type="text" name="username">
<input type="text" name="password"> 
<\form>

For the above page you would do something like...

Code:
wget -q --post-data 'username=happy&password=getin' 'http://xxx.xxxx.com/security_check'

A better way to find out what's happening exactly is to fire up WireShark, filter all HTTP transactions, login normally, and then look at the messages in WireShark.

Some pages are more of a pain than others. Some want the transactions to use SSL and some required cookies, that I've messed with. The worst pages were ones that did JavaScript page setup. I've never figured out how run the setup code from wget or curl on those type of pages.
# 3  
Old 12-29-2009
use the --debug switch in wget
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Getting the response code and to know whether web site is loaded

Hi Guys, Is there any way that we can know whether a website is fullly loaded with Linux command line ?? is there any command in Linux that can achieve that ?? Also,naturally I would also like to get the response code of the particular website/URL that i am testing for ?? Any help would be... (3 Replies)
Discussion started by: Pradeep_1990
3 Replies

2. IP Networking

Tshark/pcap and web-server response time

Hi everyone! How can I get response time difference between GET and HTTP/1.0 200 OK (i mean time latency of web-server) with using of tshark&shell or something else for each hostname from pcap file? What can you recommend me to do that? (1 Reply)
Discussion started by: lepetal
1 Replies

3. Shell Programming and Scripting

Checking for Apache and serving a page

hi i was trying to run the HTML script and was unable to run it as the apache server was not loaded on my linux server.....how do i check whether A[pache has been installed in my server or not.....???? (1 Reply)
Discussion started by: kullu
1 Replies

4. Web Development

Apache Web Server - Invalid Response

Hi, I have a SCO Unix Openserver V6 server which is hosting a website with Apache V1.3 as the http server. The web site has an initial login screen which re-directs to another page once the user name and password has been verified. When connecting to the website and trying to login, it times... (0 Replies)
Discussion started by: Martyn
0 Replies

5. Shell Programming and Scripting

Checking response of the web page?

Hi, I need to check the response of the web page without downloading any content. I used the below command. _website=http://xxx.xxx.com wget --spider --user=username --password=password $_website > /home/username/temp.txt 2>&1; I getting the below error. The web page require... (3 Replies)
Discussion started by: ahamed
3 Replies

6. Shell Programming and Scripting

Printing to a web page

I have a shell script that runs periodic upgrades on machines. I want to print certain echo commands from the shell script onto a webpage. What command in shell should I use for doing this. (1 Reply)
Discussion started by: lassimanji
1 Replies

7. UNIX Desktop Questions & Answers

Get a web page through CLI

Is there a way we can get a web page through CLI on a unix machine? Please help! (3 Replies)
Discussion started by: Pouchie1
3 Replies

8. Programming

fetching a web page in C

Hello, I'm a total newbie to HTTP commands, so I'm not sure how to do this. What I'd like is to write a C program to fetch the contents of a html page of a given address. Could someone help with this? Thanks in advance! (4 Replies)
Discussion started by: rayne
4 Replies

9. UNIX for Dummies Questions & Answers

Accessing Web Page

Hello, I am new to unix, but wanted to know how can we fetch data from a web page (i.e. an HTML Page), my requirement is to read an html page and wanted to create a flat file (text file) based on the contents available in the mentioned HTML page. Thanks Imtiaz (3 Replies)
Discussion started by: Imtiaz
3 Replies
Login or Register to Ask a Question