internal override void Build(string httpMethod, string url, string contentType, HttpParameterCollection parameters) { NameValueCollection param = null; if (parameters != null) { if (!String.IsNullOrEmpty(contentType) && contentType.ToLower().Contains("multipart/form-data")) { param = ((HttpParameterCollection)parameters.Where(itm => itm.ParameterType == HttpParameterType.Url).ToArray()).ToNameValueCollection(); } else { param = parameters.ToNameValueCollection(); } } this.Signature = new OAuthSignature ( this.SignatureMethod.ToString(), String.Format("{0}&{1}", this.ConsumerSecret, this.TokenSecret), OAuthAuthorization.GetSignatureBaseString(httpMethod, url, param, this) ).ToString(); }
/// <summary> /// Gets base string of the signature for current request (OAuth 1.0). /// </summary> /// <remarks><para>For more details, please visit <see href="http://tools.ietf.org/html/rfc5849#section-3.4.1.1"/></para></remarks> public static string GetSignatureBaseString(string httpMethod, string url, NameValueCollection parameters, OAuthAuthorization authorization) { return(OAuthAuthorization.GetSignatureBaseString(httpMethod, new Uri(url), parameters, authorization)); }