using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace skyscraper8.SatIp
{
	internal abstract class RtspRequest
	{
		protected readonly Dictionary<string, string> args;
		private string verb;
		public string RequestPath { get; set; }

		protected RtspRequest(string verb)
		{
			this.args = new Dictionary<string, string>();
			this.verb = verb;
		}

		internal string ListHeaders(string rootpath)
		{
			StringBuilder sb = new StringBuilder();
			sb.AppendFormat("{0} {1}{2} RTSP/1.0\r\n", verb, rootpath, RequestPath);
			foreach (KeyValuePair<string, string> pair in args)
			{
				sb.AppendFormat("{0}: {1}\r\n", pair.Key, pair.Value);
			}

			sb.AppendFormat("\r\n");
			return sb.ToString();
		}
	}
}
