http - 什么是客户要求?

标签 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/.. 对服务器而非客户端的请求的一部分


在上面的评论中,客户请求是什么意思?

最佳答案

来自 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/

相关文章:

image - Golang - 使用 Image 和 Image/PNG 交换图片的 PNG channel

ruby-on-rails - $http get 请求工作正常,除非我从重定向的外部链接按回

http - 检查来自应用程序的 Internet 连接

apache - 将结果从 Zookeeper 传输到网络服务器

go - 按给定 slice 对 slice 字符串进行排序/排序

google-app-engine - Appengine数据存储已损坏,如何重置

arrays - Golang解码字符串数组

java - 在 HTTP header 中发送 UTF-8 值会导致 Mojibake

ASP.net 发布和默认页面

go - goroutines 的意外输出