Checking whether a URL exist?

I try to see if a page under some specific url exists or not. The code below returns the whole page data rather than just a yes or no. Is there a way just to receive a number or yes/no for whether that specific url exist? 

local function networkListener( event )

    if ( event.isError ) then

        print( “Network error!” )

    else

        print ( "RESPONSE: " … event.response )

    end

end

– Access Google over SSL:

network.request( “https://www.seek.com.au/job/278350791?pos=3&type=standard”, “GET”, networkListener )

One option might be to try the “HEAD” request instead of “GET” … HTTP allows you to just request the headers from a given request (i.e. the server just responds with headers, not the full body of the request so it could be faster).

tried this also, but there is no event.response.

local function networkListener( event )

    if ( event.isError ) then

    else

    textObject = display.newText( event.response, 150, 250, 250,500,native.systemFont, 16 )

textObject : setTextColor( 1,1,0)

    end

end

– Access Google over SSL:

network.request( “http://www.seek.com.au/job/27778529?pos=2&type=standard”, “HEAD”, networkListener )

This may sound crazy, but have you waited for 5++ minutes to see if you get a response?

There can be 5-min default time-outs in many network stacks (basically a holdover from the days of dialup), so it could be that the system doesn’t think anything is wrong, hence no need to give you a response.  Maybe after 5 min it will finally realize that there’s a problem (and hopefully give you an idea of what the problem is).

One option might be to try the “HEAD” request instead of “GET” … HTTP allows you to just request the headers from a given request (i.e. the server just responds with headers, not the full body of the request so it could be faster).

tried this also, but there is no event.response.

local function networkListener( event )

    if ( event.isError ) then

    else

    textObject = display.newText( event.response, 150, 250, 250,500,native.systemFont, 16 )

textObject : setTextColor( 1,1,0)

    end

end

– Access Google over SSL:

network.request( “http://www.seek.com.au/job/27778529?pos=2&type=standard”, “HEAD”, networkListener )

This may sound crazy, but have you waited for 5++ minutes to see if you get a response?

There can be 5-min default time-outs in many network stacks (basically a holdover from the days of dialup), so it could be that the system doesn’t think anything is wrong, hence no need to give you a response.  Maybe after 5 min it will finally realize that there’s a problem (and hopefully give you an idea of what the problem is).