3ad2d52001-02-01Per Hedbor inherit "http_common"; void main(int argc, array argv) {
136c032001-02-20Per Hedbor  string sep = "\r\n"; int psize = 10000000;
a3d6892001-02-01Per Hedbor  if( argc < 4 ) exit( BADARG );
136c032001-02-20Per Hedbor  if( argc == 5 ) { switch( (int)argv[4] ) { case 1: break; case 2: sep = "\n"; break; case 3: psize = 1; break; case 4: psize = 10; break; } }
3ad2d52001-02-01Per Hedbor 
a3d6892001-02-01Per Hedbor  Stdio.File f = connect( argv[1] );
3ad2d52001-02-01Per Hedbor 
136c032001-02-20Per Hedbor  write_fragmented( f, "GET "+argv[2]+sep,psize );
3ad2d52001-02-01Per Hedbor  string data = f->read(); if( sizeof( data / "\r\n\r\n" ) != 1 ) exit( HEADERS ); if( (int)argv[3] ) if( data != ("\0" * (int)argv[3]) ) exit( BADDATA ); exit( OK ); }