编程语言/http:修订间差异
来自康健生活
| (未显示同一用户的8个中间版本) | |||
| 第14行: | 第14行: | ||
|} | |} | ||
== Content-Type == | == Content-Type == | ||
= | {| class="wikitable" | ||
|- | |||
| application/x-www-form-urlencoded || multipart/form-data || text/plain | |||
|- | |||
| application/json || [[/text_xml|text/xml]] || 示例 | |||
|- | |||
| 示例 || 示例 || 示例 | |||
|} | |||
== 消息主体编码 == | == 消息主体编码 == | ||
=== charset=utf-8 === | === charset=utf-8 === | ||
| 第38行: | 第38行: | ||
== URI == | == URI == | ||
统一资源标识符/通用资源标识符(Uniform Resource Identifier/Universal Resource Identifier)被定义为用于标识某一个互联网资源名称的字符串。 | |||
=== 格式 === | |||
<blockquote><pre> | |||
URI协议名称(http/ftp/mailto/file 等):协议内容</pre></blockquote> | |||
== URN == | |||
统一资源名称(Uniform Resource Name),URN 是 URL 的子集,<math>URN \subset URL</math>。 | |||
== URL == | == URL == | ||
统一资源定位符(niform Resource Locator),URL 是 URI 的子集,<math>URL \subset URI</math>。 | |||
=== SCHEME === | |||
=== 绝对 URL === | |||
=== 相对 URL === | |||
== URC == | |||
统一资源引用符(Uniform Resource Citation) | |||
== UDI == | |||
通用文档标识符(Universal Document Identifiers) | |||
== IRI == | |||
国际化资源标识符(Internationalized Resource Identifier) | |||
== HTTPS == | |||
=== tls === | |||
https://www.ssllabs.com/ssltest/index.html | |||
== 缓存 == | == 缓存 == | ||
=== 强制缓存 === | === 强制缓存 === | ||
| 第58行: | 第79行: | ||
== 缓存方案 == | == 缓存方案 == | ||
== 状态码 == | |||
[[/状态码|状态码]] | |||
== gzip == | |||
<code>Gzip</code> 压缩原理,首先使用 <code>LZ77</code> 算法{{Qm|变种}}进行字符串替换,对得到的结果使用 Huffman 树进行存储位置和长度。 | |||
== 特征 == | |||
优点是减少文件体积,提高页面渲染速度,减少页面白屏时间。 | |||
不适用于图片、音频、视频、pdf等二进制文件资源。 | |||
=== 检测是否开启 gzip === | |||
{{Shc_out|<syntaxhighlight lang="bash"> | |||
curl -I -H "Accept-Encoding: gzip,deflate" https://design.qihoo.net/</syntaxhighlight>|<syntaxhighlight lang="bash"> | |||
HTTP/2 200 | |||
server: nginx/1.22.0 | |||
date: Wed, 20 Jul 2022 08:34:56 GMT | |||
content-type: text/html | |||
last-modified: Wed, 20 Jul 2022 03:30:05 GMT | |||
etag: W/"62d776bd-5ca" | |||
content-encoding: gzip | |||
</syntaxhighlight>|$|/home/kangkk}} | |||
== error == | == error == | ||
* Provisional headers are shown | * Provisional headers are shown | ||