next up previous 89
Next: Installing and testing the server
Up: Creating a Server
Previous: Query string

Results returned

  1. The first line of information returned by the server should always be the MIME type. In simpleserver.cgi it is written by the line:

    { print "Content-type: text/plain\n\n\n";

    The MIME type is not part of the table of results, but rather is used by the client or Web browser to interpret the format of the data which follows.

  2. The list of selected objects are returned to the client as a stream of ASCII characters. The list is written in the Tab-Separated Table (TST) format (see Section [*]).

  3. The Perl script should simply write the results to standard output (whence it will be automatically forwarded to the remote client). In simpleserver.cgi the lines:

    $tst = `$queryExe $ra $dec $radius`;
    print "$tst";

    invoke program genfield (variable $queryExe has previously been set to contain the name and directory specification of the executable for genfield) to generate the star list, copy the list the to variable $tst and then write the contents of $tst to standard output. (Hint: Perl has several mechanisms for invoking processes and directing their output to standard output; I found the one described to be the most suitable for use in a CGI script.)

  4. The last line written to standard output should be:

    print "[EOD]\n";

    The string `[EOD]' informs the client that the server has finished sending data.



next up previous 89
Next: Installing and testing the server
Up: Creating a Server
Previous: Query string

Writing Catalogue and Image Servers for GAIA and CURSA
Starlink System Note 75
A.C. Davenhall
26 July 2000
E-mail:ussc@star.rl.ac.uk

Copyright © 2000 Council for the Central Laboratory of the Research Councils