Esempio n. 1
0
        protected virtual HttpWebRequest DoPrepareProtectedResourceRequest(NameValueCollection parameters, string contentType, System.IO.Stream bodyStream)
        {
            // Fire the OnBeforeGetProtectedResource event
            PreProtectedResourceRequestEventArgs preArgs = new PreProtectedResourceRequestEventArgs(
                this.ResourceUri,
                this.ResourceEndPoint.HttpMethod,
                parameters ?? new NameValueCollection(),
                this.RequestToken,
                this.AccessToken);

            if (this.OnBeforeGetProtectedResource != null)
            {
                this.OnBeforeGetProtectedResource(this, preArgs);
            }

            OAuthParameters authParams = this.CreateOAuthParameters(preArgs.AdditionalParameters);

            this.SignParameters(preArgs.RequestUri, preArgs.HttpMethod, authParams, this.AccessToken);

            return(this.CreateRequest(preArgs.RequestUri, authParams, preArgs.HttpMethod, contentType, bodyStream));
        }
Esempio n. 2
0
        protected virtual HttpWebRequest DoPrepareProtectedResourceRequest(NameValueCollection parameters, string contentType, System.IO.Stream bodyStream)
        {
            // Fire the OnBeforeGetProtectedResource event
            PreProtectedResourceRequestEventArgs preArgs = new PreProtectedResourceRequestEventArgs(
                this.ResourceUri,
                this.ResourceEndPoint.HttpMethod,
                parameters ?? new NameValueCollection(), 
                this.RequestToken, 
                this.AccessToken);

            if (this.OnBeforeGetProtectedResource != null)
                this.OnBeforeGetProtectedResource(this, preArgs);

            OAuthParameters authParams = this.CreateOAuthParameters(preArgs.AdditionalParameters);

            this.SignParameters(preArgs.RequestUri, preArgs.HttpMethod, authParams, this.AccessToken);
            
            return this.CreateRequest(preArgs.RequestUri, authParams, preArgs.HttpMethod, contentType, bodyStream);
        }