Class HttpBehaviour
This is the default implementation of the IHttpBehaviour, see IHttpBehaviour for details Most values are initialized via the HttpExtensionsGlobals
Inheritance
Inherited Members
Namespace: Dapplo.HttpExtensions
Assembly: Dapplo.HttpExtensions.dll
Syntax
public class HttpBehaviour : IChangeableHttpBehaviour, IHttpBehaviour
Properties
| Improve this Doc View SourceCookieContainer
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public CookieContainer CookieContainer { get; set; }
Property Value
| Type | Description |
|---|---|
| CookieContainer |
Current
Retrieve the current IHttpBehaviour from the CallContext, if there is nothing available, create and make it current This never returns null
Declaration
public static IHttpBehaviour Current { get; }
Property Value
| Type | Description |
|---|---|
| IHttpBehaviour |
DefaultEncoding
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public Encoding DefaultEncoding { get; set; }
Property Value
| Type | Description |
|---|---|
| Encoding |
DownloadProgress
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public Action<float> DownloadProgress { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<System.Single> |
HttpCompletionOption
The ResponseHeadersRead forces a pause between the initial response and reading the content, this is needed for better error handling and progress Turning this to ResponseContentRead might change the behaviour
Declaration
public HttpCompletionOption HttpCompletionOption { get; set; }
Property Value
| Type | Description |
|---|---|
| HttpCompletionOption |
HttpContentConverters
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public IList<IHttpContentConverter> HttpContentConverters { get; set; }
Property Value
| Type | Description |
|---|---|
| IList<IHttpContentConverter> |
HttpSettings
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public IHttpSettings HttpSettings { get; set; }
Property Value
| Type | Description |
|---|---|
| IHttpSettings |
JsonSerializer
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public IJsonSerializer JsonSerializer { get; set; }
Property Value
| Type | Description |
|---|---|
| IJsonSerializer |
OnHttpClientCreated
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public Action<HttpClient> OnHttpClientCreated { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<HttpClient> |
OnHttpContentCreated
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public Func<HttpContent, HttpContent> OnHttpContentCreated { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<HttpContent, HttpContent> |
OnHttpMessageHandlerCreated
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public Func<HttpMessageHandler, HttpMessageHandler> OnHttpMessageHandlerCreated { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<HttpMessageHandler, HttpMessageHandler> |
OnHttpRequestMessageCreated
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public Func<HttpRequestMessage, HttpRequestMessage> OnHttpRequestMessageCreated { get; set; }
Property Value
| Type | Description |
|---|---|
| Func<HttpRequestMessage, HttpRequestMessage> |
ReadBufferSize
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public int ReadBufferSize { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Int32 |
RequestConfigurations
Configuration for different parts of the library, or your own implementations, which can be set on a thread/request base
Declaration
public IDictionary<string, IHttpRequestConfiguration> RequestConfigurations { get; set; }
Property Value
| Type | Description |
|---|---|
| IDictionary<System.String, IHttpRequestConfiguration> |
ThrowOnError
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public bool ThrowOnError { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
UploadProgress
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public Action<float> UploadProgress { get; set; }
Property Value
| Type | Description |
|---|---|
| Action<System.Single> |
UseProgressStream
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public bool UseProgressStream { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
ValidateResponseContentType
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public bool ValidateResponseContentType { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
| Improve this Doc View SourceMakeCurrent()
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public void MakeCurrent()
ShallowClone()
The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.
Declaration
public IChangeableHttpBehaviour ShallowClone()
Returns
| Type | Description |
|---|---|
| IChangeableHttpBehaviour | "Shallow" Cloned instance of IChangeableHttpBehaviour |