Angus
2007-05-05 19:53:03 UTC
Hello
I am building a web server and I have worked out how to do basic GET. If a
http request is a GET then I find the file requested and write the contents
of the file to stdout.
But if the request is for a cgi file then I don't write out the contents of
the cgi file - instead I need to call the program and output the returned
text from the program. But how do I differentiate? Is it purely on the
filename requested. ie if the file is xyz.cgi or xyz.exe then I know it is
a cgi and output program output or if it is htm or html I output the file
contents? Or are cgi requests submitted in a different way to the http
server?
Angus
I am building a web server and I have worked out how to do basic GET. If a
http request is a GET then I find the file requested and write the contents
of the file to stdout.
But if the request is for a cgi file then I don't write out the contents of
the cgi file - instead I need to call the program and output the returned
text from the program. But how do I differentiate? Is it purely on the
filename requested. ie if the file is xyz.cgi or xyz.exe then I know it is
a cgi and output program output or if it is htm or html I output the file
contents? Or are cgi requests submitted in a different way to the http
server?
Angus