Error processing SSI file
Error processing SSI file

Home » Development Area » DigiGuide Listings Grabber » API Index » Class: MultiHTTPRequest

Class: MultiHTTPRequest


Summary

Allows multiple concurrent downloads in an easy to use interface.


Methods

MethodDescription
 addItem Add an item to download
 Constructor Creates a MultiHTTPRequest
 grab Begin grabbing all of the items that have been added.


Events

EventDescription
 onGotFile


Examples

The code below demonstrates grabbing 3 files and showing their status information when each has completed.

The "fatbird" download will always fail.

#include "HTTP Helpers.jsh"

var g = new Grabber( "Grabber Test MultiRequest", "GBR" );

g.onRun = function( lp )
{

var dt = new Date;

var m = new MultiHTTPRequest( 10 );

var arrRequestHeaders = new Array;
arrRequestHeaders.push( "test: nothing" );

m.addItem( "logo", "GET", "http://www.digiguide.com/i/nav/banner_gradient.gif", "", arrRequestHeaders, "", "" );
m.addItem( "home", "GET", "http://www.digiguide.com/", "", "", "", "" );
m.addItem( "fatbird", "GET", "http://www.fatbird.com/asasdsadsda.asdsa", "", arrRequestHeaders, "", "" );
m.m_grabber = this;

m.onGotFile = function( id, status, statusText, responseBody, responseHeaders )
{
var headers = new HTTPHeaders( responseHeaders );
alert( id + " Length: " + headers.get( "Content-Length" ) + " Status: " + status + " " + statusText );
return true;
}

m.grab();

return true;
}


See Also

  • XMLHttpRequest


    Requirements

    Build Build 2

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

    Error processing SSI file