客户要求是什么?

时间:2019-03-31 00:02:05

标签: http go

在下面的代码(../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 / ..请求的一部分


在以上评论中,客户要求是什么意思?

1 个答案:

答案 0 :(得分:2)

来自the Request type documentation

  

“请求”表示服务器已接收或要由客户端发送的HTTP请求。

就在您的评论上方...

// URL specifies either the URI being requested (for server
// requests) or the URL to access (for client requests).

网络浏览器发出客户请求。 Web服务器收到服务器请求。