C# 클래스 DotNetOpenAuth.ApplicationBlock.Util.WrappingWebRequestHandler

Wraps some instance of a web request handler in order to perform some extra operation on all outgoing HTTP requests.
상속: IDirectWebRequestHandler
파일 보기 프로젝트 열기: 23/23-api-dotnet

공개 메소드들

메소드 설명
CanSupport ( DirectWebRequestOptions options ) : bool

Determines whether this instance can support the specified options.

GetRequestStream ( HttpWebRequest request ) : Stream

Prepares an HttpWebRequest that contains an POST entity for sending the entity.

The caller should have set the HttpWebRequest.ContentLength and any other appropriate properties before calling this method. Callers must close and dispose of the request stream when they are done writing to it to avoid taking up the connection too long and causing long waits on subsequent requests.

Implementations should catch WebException and wrap it in a ProtocolException to abstract away the transport and provide a single exception type for hosts to catch.

GetRequestStream ( HttpWebRequest request, DirectWebRequestOptions options ) : Stream

Prepares an HttpWebRequest that contains an POST entity for sending the entity.

The caller should have set the HttpWebRequest.ContentLength and any other appropriate properties before calling this method. Callers must close and dispose of the request stream when they are done writing to it to avoid taking up the connection too long and causing long waits on subsequent requests.

Implementations should catch WebException and wrap it in a ProtocolException to abstract away the transport and provide a single exception type for hosts to catch.

GetResponse ( HttpWebRequest request ) : DotNetOpenAuth.Messaging.IncomingWebResponse

Processes an HttpWebRequest and converts the HttpWebResponse to a IncomingWebResponse instance.

Implementations should catch WebException and wrap it in a ProtocolException to abstract away the transport and provide a single exception type for hosts to catch. The WebException.Response value, if set, should be Closed before throwing.

GetResponse ( HttpWebRequest request, DirectWebRequestOptions options ) : DotNetOpenAuth.Messaging.IncomingWebResponse

Processes an HttpWebRequest and converts the HttpWebResponse to a IncomingWebResponse instance.

Implementations should catch WebException and wrap it in a ProtocolException to abstract away the transport and provide a single exception type for hosts to catch. The WebException.Response value, if set, should be Closed before throwing.

비공개 메소드들

메소드 설명
WrappingWebRequestHandler ( IDirectWebRequestHandler wrappedHandler, Action action ) : System

Initializes a new instance of the WrappingWebRequestHandler class.

메소드 상세

CanSupport() 공개 메소드

Determines whether this instance can support the specified options.
public CanSupport ( DirectWebRequestOptions options ) : bool
options DirectWebRequestOptions The set of options that might be given in a subsequent web request.
리턴 bool

GetRequestStream() 공개 메소드

Prepares an HttpWebRequest that contains an POST entity for sending the entity.

The caller should have set the HttpWebRequest.ContentLength and any other appropriate properties before calling this method. Callers must close and dispose of the request stream when they are done writing to it to avoid taking up the connection too long and causing long waits on subsequent requests.

Implementations should catch WebException and wrap it in a ProtocolException to abstract away the transport and provide a single exception type for hosts to catch.

Thrown for any network error.
public GetRequestStream ( HttpWebRequest request ) : Stream
request System.Net.HttpWebRequest The that should contain the entity.
리턴 Stream

GetRequestStream() 공개 메소드

Prepares an HttpWebRequest that contains an POST entity for sending the entity.

The caller should have set the HttpWebRequest.ContentLength and any other appropriate properties before calling this method. Callers must close and dispose of the request stream when they are done writing to it to avoid taking up the connection too long and causing long waits on subsequent requests.

Implementations should catch WebException and wrap it in a ProtocolException to abstract away the transport and provide a single exception type for hosts to catch.

Thrown for any network error.
public GetRequestStream ( HttpWebRequest request, DirectWebRequestOptions options ) : Stream
request System.Net.HttpWebRequest The that should contain the entity.
options DirectWebRequestOptions The options to apply to this web request.
리턴 Stream

GetResponse() 공개 메소드

Processes an HttpWebRequest and converts the HttpWebResponse to a IncomingWebResponse instance.

Implementations should catch WebException and wrap it in a ProtocolException to abstract away the transport and provide a single exception type for hosts to catch. The WebException.Response value, if set, should be Closed before throwing.

Thrown for any network error.
public GetResponse ( HttpWebRequest request ) : DotNetOpenAuth.Messaging.IncomingWebResponse
request System.Net.HttpWebRequest The to handle.
리턴 DotNetOpenAuth.Messaging.IncomingWebResponse

GetResponse() 공개 메소드

Processes an HttpWebRequest and converts the HttpWebResponse to a IncomingWebResponse instance.

Implementations should catch WebException and wrap it in a ProtocolException to abstract away the transport and provide a single exception type for hosts to catch. The WebException.Response value, if set, should be Closed before throwing.

Thrown for any network error.
public GetResponse ( HttpWebRequest request, DirectWebRequestOptions options ) : DotNetOpenAuth.Messaging.IncomingWebResponse
request System.Net.HttpWebRequest The to handle.
options DirectWebRequestOptions The options to apply to this web request.
리턴 DotNetOpenAuth.Messaging.IncomingWebResponse