Error processing SSI file
Error processing SSI file

Home » Development Area » DigiGuide Listings Grabber » API Index » Class: XMLHttpRequest » getResponseHeader Method

Class XMLHttpRequest : getResponseHeader Method


String getResponseHeader( String headerName )

Summary

Get a specific HTTP response header value


Remarks

List of response/request headers at the w3.


Parameters

ParameterDescription
String headerName


Examples

Downloads a file but only if it has changed since the last time it was downloaded.

var client = new XMLHttpRequest();

client.open("GET", "http://www.digiguide.com/i/nav/banner_gradient.gif", false );

var mail = new File( this.dataFolder + "banner_gradient.gif" );
if( mail.exists )
{
mail.open( "read", "text" )
client.setRequestHeader( "If-Modified-Since", mail.lastModified.toUTCString() );
mail.close();
}

client.send("");

if( client.status == "200" )
{
var mail = new File( this.dataFolder + "banner_gradient2.gif" );
mail.open( "readWrite,replace,create", "text" );
mail.write( client.responseBody );
mail.close();
}
else if( client.status == "304" )
{
lp.writeLog( "Not modified since: " + client.getResponseHeader( "last-modified" ) );
}
else
{
alert( "Failed with error " + client.status + " " + client.statusText );
}


See Also

  • XMLHttpRequest : getAllResponseHeaders
  • XMLHttpRequest : setRequestHeader


    Requirements

    Build Build 1

    (Last updated: October 12, 2007 16:23:26)

    Error processing SSI file