Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> utl_http.request

utl_http.request

From: Lockie, Bob <bjlockie_at_americasm97.nt.com>
Date: Wed, 02 Feb 2000 19:12:35 -0500
Message-ID: <3898C7F3.24192FE6@americasm97.nt.com>

Help.

exec :res := utl_http.request( 'http://localhost:2000/httptest.cgi' ); Fails when calling a pseudo web server (something that listens on port 2000 via inetd).

The following is my "server" code.
I can't seem to get it right.
What is the proper response for a web server? I think Oracle is looking for that.

#include <stdio.h>

#define MAXLINELEN 1024

main(int argc, char *argv[ ], char *envp[ ]) {

    char szLine[MAXLINELEN];

        printf( "Content-type: text/html\n\r" );
        printf( "HTTP/1.1 200 npauth request\n\r" );
        printf( "Server: Pseudo\n\r" );

        fflush( stdout );

        fgets( szLine, MAXLINELEN, stdin );

        printf( "%s", "<HTML>\n" );
        printf( "%s", "<HEAD>\n" );
        printf( "%s", "<TITLE>Show Log '$command'</TITLE>\n" );
        printf( "%s", "</HEAD>\n" );
        printf( "%s", "<H1>Show Log '$command'</H1>\n" );
        printf( "%s", "<PRE>\n" );
        printf( "%s", "$results\n" );
        fflush(stdout);

    exit( 0 );
} Received on Wed Feb 02 2000 - 18:12:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US