http.Request
类型的作用是表示HTTP请求,该类型可以用于表示服务器接收的请求,或在HTTP客户端即将发送到服务器的请求。
源代码https://golang.org/src/net/http/request.go中定义的http.Request
结构类型如下:
type Request struct { Method string URL *url.URL Proto string // "HTTP/1.0" ProtoMajor int // 1 ProtoMinor int // 0 Header Header Body io.ReadCloser GetBody func() (io.ReadCloser, error) ContentLength int64 TransferEncoding []string Close bool Host string Form url.Values PostForm url.Values MultipartForm *multipart.Form Trailer Header RemoteAddr string RequestURI string TLS *tls.ConnectionState Cancel <-chan struct{} Response *Response ctx context.Context }