在下面的代码中(../src/net/http/request.go
):
// For server requests, the URL is parsed from the URI
// supplied on the Request-Line as stored in RequestURI. For
// most requests, fields other than Path and RawQuery will be
// empty. (See RFC 7230, Section 5.3)
//
// For client requests, the URL's Host specifies the server to
// connect to, while the Request's Host field optionally
// specifies the Host header value to send in the HTTP
// request.
URL *url.URL
URL protocol://hostname:port/resource_path
用作 GET/POST/.. 对服务器而非客户端的请求的一部分
在上面的评论中,客户请求是什么意思?
最佳答案
来自 the Request type documentation
A Request represents an HTTP request received by a server or to be sent by a client.
在您的评论上方...
// URL specifies either the URI being requested (for server // requests) or the URL to access (for client requests).
Web 浏览器发出客户端请求。 Web 服务器接收服务器请求。
关于http - 什么是客户要求?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55436721/