title: How to parse RTSP request and response headers?
body: <p>I'm in the middle of building an RTSP server, and am creating two request/response objects named <code>TRTSPRequest</code> and <code>TRTSPResponse</code> similar to <code>TWebRequest</code> and <code>TWebResponse</code> but specific to RTSP. I have a feeling I'm re-inventing the wheel and that there's a much easier path I can take here. I've gotten 400 lines of code into creating this server, and most of it is just parsing the request headers.</p>
  
  <p>Is there something in Delphi XE2 / Indy 10 I can re-use that can parse the RTSP headers for me? Or am I stuck having to parse it all myself?</p>
  
  <p>Since RTSP is very similar to HTTP, can I use the HTTP request/response objects? Or will it get confused by the RTSP structure?</p>
  
  <p>For example, can I use <code>IdHTTPHeaderInfo.pas</code> and tweak it all for RTSP and call it <code>IdRTSPHeaderInfo.pas</code>?</p>
  
  <p>According to <a href="http://www.ietf.org/rfc/rfc2326.txt" rel="nofollow">RFC 2326</a>...</p>
  
  <blockquote>
    <p>Easy to parse:
    RTSP can be parsed by standard HTTP or MIME parsers.</p>
  </blockquote>
  
  <p>and</p>
  
  <blockquote>
    <p>HTTP-friendly:
              Where sensible, RTSP reuses HTTP concepts, so that the
              existing infrastructure can be reused. This infrastructure
              includes PICS (Platform for Internet Content Selection
              [15,16]) for associating labels with content. However, RTSP
              does not just add methods to HTTP since the controlling
              continuous media requires server state in most cases.</p>
  </blockquote>
  
  <p>So how should I do this?</p>