Leanpub Header

Skip to main content

HTTP小书

准能帮你节省不少时间

针对读者,它准能帮你省下不少时间,你不必啃砖头大的资料了

Minimum price

$7.99

$9.99

You pay

$9.99

Author earns

$7.99
$

...Or Buy With Credits!

You can get credits monthly with a Reader Membership
PDF
EPUB
WEB
About

About

About the Book

如今的软件产品,越来越多的以HTTP为基础的网络协议。而我在日常工作一点一滴的感到它的价值,也觉得没有系统的掌握它是一个遗憾。年初的一个机缘,我开始投入研究HTTP。我买了一组书,其中的那个砖头书,我买了4本,放到车上、办公室、家、另一个办公室。这样反复的啃,然后使用node.js做技术验证。接触的多了,眼光和纯粹的用户自然开始有些变化。

于是,很自然的有一天,我听到一个声音说:“为它写点什么,这准是个有趣的事儿“。因为:

1. 它用的人多,所以非常有用

2. 已有的资料,过于纠缠细节

HTTP 本该简单,可要是按着协议文本的严格,就容易显得呆板。所以,我可以:

1. 直接了当。说清楚场景和价值,然后给出案例和验证代码

2. 高屋建瓴。有了架构,读者自己弄的明白细节

我会用第一章通过案例引出HTTP的架构。随后的章节,我把大卸八块的HTTP的每个块给出场景,然后是交互过程。有些特别难区别的,还会来些命令行和少量代码。所以,这正是一本HTTP的书,是一个程序员写就的,也写给程序员。我希望它看起来像是好的代码风格一样的直接了当、详略得当。

针对读者,它准能帮你省下不少时间,因为你本来需要啃砖头大的几块资料的,并且是反复啃才行——因为我就是。

现在,它就摆在你的面前。

Author

About the Author

Reco

Reco is an entrepreneur and product manager, is a programmer who loves reading and enjoys sharing.

Contents

Table of Contents

前言

引入

  1. 请求消息
  2. 响应消息

术语

  1. 资源(resource)
  2. 资源类型
  3. 资源标示符
  4. HTTP事务
  5. HTTP方法
  6. 状态码
  7. 消息

实验环境

  1. node.js
  2. netcat

一点历史

HTTP 请求

  1. 请求方法
  2. 消息主体 message-body
  3. 稍作总结
  4. GET 方法
  5. POST 方法
  6. OPTIONS 方法
  7. PUT,DELETE方法
  8. CONNECT 方法

HTTP 响应

  1. 状态行( Status-Line)
  2. 消息主体 message-body
  3. 200 型响应
  4. 300 型响应
  5. 400 型响应
  6. 500 型响应
  7. 100型响应
  8. 101 型响应

消息主体

  1. 内容编码
  2. 传输编码
  3. 拖挂

连接的利用方法

  1. 并行连接
  2. keep-alive连接
  3. 持久连接
  4. 管线

客户识别

  1. 格式

后记

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub