FlickrNet.TwitterResponder.OAuthCalculateAuthHeader C# (CSharp) Method

OAuthCalculateAuthHeader() public static method

Returns the string for the Authorisation header to be used for OAuth authentication. Parameters other than OAuth ones are ignored.
public static OAuthCalculateAuthHeader ( string>.Dictionary parameters ) : string
parameters string>.Dictionary OAuth and other parameters.
return string
        public static string OAuthCalculateAuthHeader(Dictionary<string, string> parameters)
        {
            StringBuilder sb = new StringBuilder("OAuth ");

            var sorted = parameters.OrderBy(x => x.Key);

            foreach (KeyValuePair<string, string> pair in sorted)
            {
                if (pair.Key.StartsWith("oauth"))
                {
                    sb.Append(pair.Key + "=\"" + Uri.EscapeDataString(pair.Value) + "\",");
                }
            }

            return sb.Remove(sb.Length - 1, 1).ToString();
        }