Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> utl_http.request
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