3ad2d52001-02-01Per Hedbor inherit "http_common"; void main(int argc, array argv) {
a3d6892001-02-01Per Hedbor  string sep; if( argc < 4 ) exit( BADARG ); if( argc == 5 ) sep = "\n"; else sep = "\r\n";
3ad2d52001-02-01Per Hedbor  Stdio.File f = connect( argv[1] );
a3d6892001-02-01Per Hedbor  f->write( "GET "+argv[2]+" HTTP/1.0"+sep+ "User-Agent: testcript"+sep+ sep );
3ad2d52001-02-01Per Hedbor  string _d = f->read(); array q = _d/"\r\n\r\n"; if( sizeof( q ) < 2 ) exit( BADHEADERS );
a3d6892001-02-01Per Hedbor  verify_headers( q[0], strlen(q[1]), "HTTP/1.0", (argv[2] != "/nofile" ? 200 : 404), (argv[2][strlen(argv[2])-3..]=="raw"));
3ad2d52001-02-01Per Hedbor  if( (int)argv[3] ) if( q[1] != ("\0" * (int)argv[3]) ) exit( BADDATA ); exit( OK ); }