跳到主要内容

3.1. Accept-Patch Header

3.1. Accept-Patch Header

本规范引入新的 response header Accept-Patch, 用于指定服务器接受的 patch document formats. 对于任何支持使用 PATCH method 的资源, Accept-Patch 应该出现在 OPTIONS response 中. 对任何 method 的响应中出现 Accept-Patch header, 都隐式表示 Request-URI 所标识的资源允许使用 PATCH. 此 header 中出现某个特定 patch document format, 表示 Request-URI 所标识的资源允许使用该特定格式.

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

Accept-Patch header 指定以逗号分隔的 media-types 列表 (带可选parameters), 如 [RFC2616] 第 3.7 节所定义.

示例:

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

Accept-Patch header 也会出现在 415 (Unsupported Media Type) response 中, 用于指示服务器支持的 patch document formats, 如第 2.2 节所述.