Checking website with cfhttp

Hello experts-

I have a list of websites I wanted to loop through and check to see if they are running.  I am checking the head in the cfhttp tag, but not getting the cfhttp.responseheader.status_code.

Any help would be appreciated

<cfset urlList ='http://www.keywordconnectss.com,http://google.com, http://www.marano-us.com,http://www.yahoo.com,http://www.espnnn.com'>
<cfloop list="#urlList#" index="i">
	<cfhttp method="head" url="#i#">

<cfoutput>

 #i#
 <cfif isDefined("cfhttp.responseheader.status_code")>
 	<cfset status =  #cfhttp.responseheader.status_code#>
    <cfelse>
    <cfset status = 404>
    #status#<br />
 </cfif>

Open in new window

LVL 2
nmaranoAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

_agx_Commented:
I'm not near a CF install right now, but what do you mean by not found?

You can always use cfhttp.statusCode.  It includes both the status code and text. Just use list functions to grab the code number:
       
        <cfset status = listFirst(cfhttp.statusCode, " ")>

BTW, cfhttp.statusCode should always be defined. So you shouldn't need isDefined.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
nmaranoAuthor Commented:
thanks will try that
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.