Jump to content
Sign in to follow this  
Dieuz

Check HTTP status code

Recommended Posts

Dieuz

Is there any function out there to retrieve the HTTP Status code of a webpage?

I want to check every ten minutes or so if my website is still online.

I thought of using Ping but this function doesnt seems to return lot of infos...

Thanks!

:mellow:

Edited by Dieuz

Share this post


Link to post
Share on other sites
Fire

Also you can try this udf too http://www.autoitscript.com/forum/index.php?showtopic=84133

#include "WinHTTP.au3"
$nOffset = 1

$input=InputBox("Enter Site URL","ENTER SITE URL","","")
$hOpen = _WinHttpOpen()

$hConnect = _WinHttpConnect($hOpen, $input)

$hRequest = _WinHttpOpenRequest($hConnect, "GET", "/")

_WinHttpSendRequest($hRequest)

_WinHttpReceiveResponse($hRequest)

If _WinHttpQueryDataAvailable($hRequest) Then
    $header = _WinHttpQueryHeaders($hRequest)

_WinHttpCloseHandle($hRequest)

_WinHttpCloseHandle($hConnect)

_WinHttpCloseHandle($hOpen)




FileWrite(@TempDir&"\headerinfo.ini",$header)

 EndIf


$str=FileRead(@TempDir&"\headerinfo.ini")

MsgBox(64,"",FileReadLine(@TempDir&"\headerinfo.ini",1))
FileDelete(@TempDir&"\headerinfo.ini")

[size="5"] [/size]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×