import (
"net/http/cgi"
"net/http"
"fmt"
)
func errorResponse(code int, msg string) {
fmt.Printf("Status:%d %s\r\n", code, msg)
fmt.Printf("Content-Type: text/plain\r\n")
fmt.Printf("\r\n")
fmt.Printf("%s\r\n", msg)
}
func main() {
var req *http.Request
var err error
req, err = cgi.Request()
if err != nil {
errorResponse(500, "cannot get cgi request" + err.Error())
return
}
fmt.Printf("Content-Type: text/html\r\n")
fmt.Printf("\r\n")
fmt.Printf("<pre>\n")
fmt.Printf("req=%v\r\n", req) }
沒有留言:
張貼留言