/// <summary> /// Build up the canon required for signing /// </summary> /// <param name="method"></param> /// <param name="host"></param> /// <param name="uri"></param> /// <param name="queryString"></param> /// <returns></returns> private static String GetCanonRequest(HttpWebRequestMethod method, string host, string uri, string queryString) { var canon = new StringBuilder(); canon.Append(string.Format("{0}\n", method.ToString().ToUpper())); canon.Append(string.Format("{0}\n", host.ToLower())); canon.Append(string.Format("{0}\n", uri)); canon.Append(queryString); return canon.ToString(); }
/// <summary> /// Build up the canon required for signing /// </summary> /// <param name="method"></param> /// <param name="host"></param> /// <param name="uri"></param> /// <param name="queryString"></param> /// <returns></returns> private static String GetCanonRequest(DateTime date, HttpWebRequestMethod method, string host, string uri, string queryString) { var canon = new StringBuilder(); canon.Append(string.Format("{0}\n", date.ToUniversalTime().ToString(new System.Globalization.DateTimeFormatInfo().RFC1123Pattern))); canon.Append(string.Format("{0}\n", method.ToString().ToUpper())); canon.Append(string.Format("{0}\n", host.ToLower())); canon.Append(string.Format("{0}\n", uri)); canon.Append(queryString); return canon.ToString(); }