Query HTTP server

Hi,

is there any way in bash to query the round trip time to a http server? I have to use the http protocol so ping is no good.  I have to compare this to ping. I thought wget might have something but I couldn't find what to use.

Thanks
LVL 1
PaulmulAsked:
Who is Participating?
 
asbharadwajConnect With a Mentor Commented:
Well Yes
It can be done in Perl
Im a beginner in Perl and I dont know much about it and
Im much more comfortable with C.
However a good starting point will be
http://www.cs.cf.ac.uk/Dave/PERL/node169.html#SECTION001910000000000000000

Its a brief overview of various capabilities of Perl. Iam using this for Perl basics :-)
0
 
asbharadwajCommented:
Iam not aware of any bash command for this purpose. But
You can write a small program that sends a HTTP Get request to the server
and measures the response time
Its really very simple
All you need to do is open a socket, connect to the server port 80 (or whatever the
server is listening to), note the time, send the http get request, wait for response,
note down time, calculate difference and you have the round trip time.
0
 
PaulmulAuthor Commented:
Can this be done in perl?  I am using perl and bash for this.
0
 
PaulmulAuthor Commented:
I am also quite new to perl, I prefer it to C though
0
 
jared71Commented:
try curl, works great.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.