C# 클래스 SimpleOAuth.OAuthRequestWrapper

Contains a WebRequest and does all the necessary work in order to sign it as a valid OAuth request before it gets sent.
파일 보기 프로젝트 열기: cbenard/SimpleOAuth.Net

Private Properties

프로퍼티 타입 설명
OAuthRequestWrapper System
createAuthorization void
createSignature void

공개 메소드들

메소드 설명
InHeader ( ) : void

Complete the request signing and add the OAuth information to the Authorization header.

This must be your last step in the function chain.

WithCallback ( string callbackUrl ) : OAuthRequestWrapper

Set the callback address that the OAuth Request Token stage should use.

The oauth_callback is sometimes required at the Request Token stage in a three-legged OAuth login request. It is possible to set this for other request, but may be unexpected and cause issues.

WithEncryption ( EncryptionMethod enc ) : OAuthRequestWrapper

Set the encryption method that should be used for this request.

This is equivalent to setting OAuthRequestWrapper.SigningMethod. If it is not set, the default is to use EncryptionMethod.HMACSHA1.

WithPostParameters ( string parameters ) : OAuthRequestWrapper

Provide the POST request to generate a valid OAuth signature.

The OAuth standard requires POST parameters sent in application/x-www-form-urlencoded requests to be included in the OAuth base string to create a valid signature. If it is not provided, then the request will fail. If this is set, then the WebRequest.ContentType of the OAuthRequestWrapper.ContainedRequest will be set to 'application/x-www-form-urlencoded' if it is not already set.

WithTokens ( SimpleOAuth.Tokens oauthTokens ) : OAuthRequestWrapper

Set the tokens that should be used for this request.

This is equivalent to setting OAuthRequestWrapper.RequestTokens.

WithVerifier ( string verifier ) : OAuthRequestWrapper

Set the oauth_verifier in the OAuth Access Token stage.

WithVersion ( string version ) : OAuthRequestWrapper

Set the version of OAuth being used.

This is equivalent to setting OAuthRequestWrapper.OAuthVersion. If this is not set, then "1.0" is used.

비공개 메소드들

메소드 설명
OAuthRequestWrapper ( WebRequest toContain ) : System

There is only one constructor, and the OAuthRequestWrapper can only be instantiated internally to the library.

createAuthorization ( ) : void
createSignature ( ) : void

메소드 상세

InHeader() 공개 메소드

Complete the request signing and add the OAuth information to the Authorization header.
This must be your last step in the function chain.
public InHeader ( ) : void
리턴 void

WithCallback() 공개 메소드

Set the callback address that the OAuth Request Token stage should use.
The oauth_callback is sometimes required at the Request Token stage in a three-legged OAuth login request. It is possible to set this for other request, but may be unexpected and cause issues.
public WithCallback ( string callbackUrl ) : OAuthRequestWrapper
callbackUrl string An address or some other string to pass as the OAuth callback.
리턴 OAuthRequestWrapper

WithEncryption() 공개 메소드

Set the encryption method that should be used for this request.
This is equivalent to setting OAuthRequestWrapper.SigningMethod. If it is not set, the default is to use EncryptionMethod.HMACSHA1.
public WithEncryption ( EncryptionMethod enc ) : OAuthRequestWrapper
enc EncryptionMethod A
리턴 OAuthRequestWrapper

WithPostParameters() 공개 메소드

Provide the POST request to generate a valid OAuth signature.
The OAuth standard requires POST parameters sent in application/x-www-form-urlencoded requests to be included in the OAuth base string to create a valid signature. If it is not provided, then the request will fail. If this is set, then the WebRequest.ContentType of the OAuthRequestWrapper.ContainedRequest will be set to 'application/x-www-form-urlencoded' if it is not already set.
public WithPostParameters ( string parameters ) : OAuthRequestWrapper
parameters string The POST parameters that will be sent.
리턴 OAuthRequestWrapper

WithTokens() 공개 메소드

Set the tokens that should be used for this request.
This is equivalent to setting OAuthRequestWrapper.RequestTokens.
public WithTokens ( SimpleOAuth.Tokens oauthTokens ) : OAuthRequestWrapper
oauthTokens SimpleOAuth.Tokens A object containing the Consumer and/or Access tokens.
리턴 OAuthRequestWrapper

WithVerifier() 공개 메소드

Set the oauth_verifier in the OAuth Access Token stage.
public WithVerifier ( string verifier ) : OAuthRequestWrapper
verifier string The oauth_verifier string used to verify the request.
리턴 OAuthRequestWrapper

WithVersion() 공개 메소드

Set the version of OAuth being used.
This is equivalent to setting OAuthRequestWrapper.OAuthVersion. If this is not set, then "1.0" is used.
public WithVersion ( string version ) : OAuthRequestWrapper
version string The version number to use.
리턴 OAuthRequestWrapper