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
Показать файл Открыть проект

Открытые методы

Метод Описание
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