知识卡片

普通读书笔记卡 · 10651.a · 生成模型:未记录

传输与HTTP消息分层

理解等级:初级

TCP 给客户端和服务器提供字节流,HTTP 定义如何在其中表示方法、请求目标、状态码、头部和消息体。接受到连接只建立了双方可通信的通道,客户端要收到成功页面,还须从流中读请求并写入合法 HTTP 响应。一次连接和一条应用消息是不同抽象,教学代码采用一连接处理一次请求。

这张卡片看不懂?

已有反馈 · 0 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    参考来源

    - 位置:《The Rust Programming Language(第2版)》第20章 最终项目:构建多线程 Web 服务器(来源项目 a19c7933-4eda-4176-aebd-30fe7e1ad292,`extracted/The Rust Programming Language(第2版)/_epub-src/c20.xhtml`,块 0017) - 结论依据:原文把 TCP 的传输作用与 HTTP 的请求、响应内容约定区分开。 - 原始内容:TCP is the lower-level protocol that describes the details of how information gets from one server to another but doesn’t specify what that information is. HTTP builds on top of TCP by defining the contents of the requests and responses. It’s technically possible to use HTTP with other protocols, but in the vast majority of cases, HTTP sends its data over TCP.