CGI C/C++

In computing, Common Gateway Interface (CGI) offers a standard protocol for web servers to execute programs that execute like console applications (also called command-line interface programs) running on a server that generates web pages dynamically. Such programs are known as CGI scripts or simply as CGIs. The specifics of how the script is executed by the server are determined by the server. In the common case, a CGI script executes at the time a request is made and generates HTML.[1].

简单来说:CGI提供了像执行命令行程序那样在web服务器上执行程序并产生动态网页的标准协议。


In brief, an HTTP GET request from the client will send the CGI program HTML form data via standard input. Other data, such as URL paths, and HTTP header data, are presented as process environment variables.

实现GET方式,客户端的数据将通过标准输入发送非CGI程序, 例如PATH等其他数据则会显示在环境变量中。

Format
Content-Type
HTML text/html
Text text/plain
GIF image/gif
JPEG image/jpeg
PostScript application/postscript
MPEG video/mpeg

在Linux环境下使用tinyhttpd作为服务器搭建github下载添加至linux设备即可



猜你喜欢

转载自blog.csdn.net/httpdrestart/article/details/80693183
CGI