6 Request (请求)
6 Request (请求)
从客户端到服务器或反向的请求消息, 在该消息首行中包含要应用于资源的方法, 资源的标识符, 以及所用协议版本。
Request = Request-Line ; Section 6.1
*( general-header ; Section 5
| request-header ; Section 6.2
| entity-header ) ; Section 8.1
CRLF
[ message-body ] ; Section 4.3
6.1 Request Line (请求行)
Request-Line = Method SP Request-URI SP RTSP-Version CRLF
Method = "DESCRIBE" ; Section 10.2
| "ANNOUNCE" ; Section 10.3
| "GET_PARAMETER" ; Section 10.8
| "OPTIONS" ; Section 10.1
| "PAUSE" ; Section 10.6
| "PLAY" ; Section 10.5
| "RECORD" ; Section 10.11
| "REDIRECT" ; Section 10.10
| "SETUP" ; Section 10.4
| "SET_PARAMETER" ; Section 10.9
| "TEARDOWN" ; Section 10.7
| extension-method
extension-method = token
Request-URI = "*" | absolute_URI
RTSP-Version = "RTSP" "/" 1*DIGIT "." 1*DIGIT
6.2 Request Header Fields (请求头部字段)
request-header = Accept ; Section 12.1
| Accept-Encoding ; Section 12.2
| Accept-Language ; Section 12.3
| Authorization ; Section 12.5
| From ; Section 12.20
| If-Modified-Since ; Section 12.23
| Range ; Section 12.29
| Referer ; Section 12.30
| User-Agent ; Section 12.41
注意, 与 HTTP/1.1 [2] 相反, RTSP 请求始终包含绝对 URL (即含 scheme, host 与 port), 而非仅绝对路径。
HTTP/1.1 要求服务器理解绝对 URL, 但客户端应使用 Host 请求头部。这纯粹是为与 HTTP/1.0 服务器向后兼容, 该考虑不适用于 RTSP。
Request-URI 中的星号 "*" 表示请求不针对特定资源而针对服务器本身, 且仅当所用方法不一定适用于资源时才允许。一例为:
OPTIONS * RTSP/1.0