C# Class DotNetOpenAuth.ApplicationBlock.Util.WrappingWebRequestHandler

Wraps some instance of a web request handler in order to perform some extra operation on all outgoing HTTP requests.
Inheritance: IDirectWebRequestHandler
Afficher le fichier Open project: 23/23-api-dotnet

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
WrappingWebRequestHandler ( IDirectWebRequestHandler wrappedHandler, Action action ) : System

Initializes a new instance of the WrappingWebRequestHandler class.

Method Details

CanSupport() public méthode

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.
Résultat bool

GetRequestStream() public méthode

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.
Résultat Stream

GetRequestStream() public méthode

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.
Résultat Stream

GetResponse() public méthode

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.
Résultat DotNetOpenAuth.Messaging.IncomingWebResponse

GetResponse() public méthode

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.
Résultat DotNetOpenAuth.Messaging.IncomingWebResponse