Skip to main content

3.1. Accept-Patch 头字段 (The Accept-Patch Header)

3.1. Accept-Patch 头字段 (The Accept-Patch Header)

本规范引入了一个新的响应头 Accept-Patch, 用于指定服务器接受的补丁文档格式. Accept-Patch 应该 (SHOULD) 出现在任何支持使用 PATCH 方法的资源的 OPTIONS 响应中. Accept-Patch 头在响应任何方法时的存在是 PATCH 在由 Request-URI 标识的资源上被允许的隐式指示. 此头中特定补丁文档格式的存在表明该特定格式在由 Request-URI 标识的资源上被允许.

Accept-Patch = "Accept-Patch" ":" 1#media-type

Accept-Patch 头指定了由 [RFC2616] 第 3.7 节定义的媒体类型 (media-types) (带有可选参数) 的逗号分隔列表.

示例:

Accept-Patch: text/example;charset=utf-8

Accept-Patch 头也出现在 415 (Unsupported Media Type) 响应中, 以指示服务器支持的补丁文档格式, 如第 2.2 节所述.