• Articles
  • Api Documentation
Show / Hide Table of Contents
  • Dapplo.HttpExtensions
    • AuthorizationExtensions
    • HttpBehaviour
    • HttpBehaviourExtensions
    • HttpClientExtensions
    • HttpContentExtensions
    • HttpExtensionsGlobals
    • HttpRequestMessageConfiguration
    • HttpRequestMessageExtensions
    • HttpResponse
    • HttpResponse<TResponse, TErrorResponse>
    • HttpResponse<TResponse>
    • HttpResponseMessageExtensions
    • HttpResponseWithError<TErrorResponse>
    • IChangeableHttpBehaviour
    • IHttpBehaviour
    • IHttpContentConverter
    • IHttpRequestConfiguration
    • IHttpSettings
    • IJsonSerializer
    • MiscExtensions
    • UriActionExtensions
    • UriModifyExtensions
    • UriParseExtensions
  • Dapplo.HttpExtensions.ContentConverter
    • ByteArrayHttpContentConverter
    • DefaultJsonHttpContentConverter
    • DefaultJsonHttpContentConverterConfiguration
    • FormUriEncodedContentConverter
    • StreamHttpContentConverter
    • StringConfiguration
    • StringHttpContentConverter
    • SyndicationFeedHttpContentConverter
    • XDocumentHttpContentConverter
  • Dapplo.HttpExtensions.Extensions
    • EnumExtensions
    • HttpBehaviourExtensions
    • StringExtensions
    • TypeExtensions
  • Dapplo.HttpExtensions.Factory
    • HttpClientFactory
    • HttpContentFactory
    • HttpMessageHandlerFactory
    • HttpRequestMessageFactory
    • WebProxyFactory
  • Dapplo.HttpExtensions.JsonNet
    • JsonNetJsonSerializer
    • ReadOnlyConsideringContractResolver
  • Dapplo.HttpExtensions.JsonSimple
    • DataContractJsonSerializerStrategy
    • DefaultJsonHttpContentConverter
    • IJsonSerializerStrategy
    • JsonExtensionDataAttribute
    • PocoJsonSerializerStrategy
    • SimpleJson
    • SimpleJsonSerializer
  • Dapplo.HttpExtensions.Listener
    • HttpListenerContextExtensions
    • ListenerPortExtensions
    • UriHttpListenerExtensions
  • Dapplo.HttpExtensions.OAuth
    • AuthorizeModes
    • BaseOAuthSettings
    • GrantTypes
    • ICodeReceiverSettings
    • IOAuth1Token
    • IOAuth2Token
    • IOAuthCodeReceiver
    • OAuth1HttpBehaviour
    • OAuth1HttpBehaviourFactory
    • OAuth1HttpMessageHandler
    • OAuth1Parameters
    • OAuth1RequestConfiguration
    • OAuth1Settings
    • OAuth1SignatureTransports
    • OAuth1SignatureTypes
    • OAuth1Token
    • OAuth2HttpBehaviourFactory
    • OAuth2HttpMessageHandler
    • OAuth2Settings
    • OAuth2TokenResponse
    • OAuthExtensions
  • Dapplo.HttpExtensions.OAuth.CodeReceivers
    • EmbeddedBrowserCodeReceiver
  • Dapplo.HttpExtensions.OAuth.Desktop
    • OAuthLoginForm
  • Dapplo.HttpExtensions.Support
    • HttpPartAttribute
    • HttpParts
    • HttpRequestAttribute
    • HttpResponseAttribute
    • HttpSettings
    • MediaTypes
    • ProgressStream
    • ProgressStreamReport
  • Dapplo.HttpExtensions.SystemTextJson
    • SystemTextJsonSerializer
  • Dapplo.HttpExtensions.WinForms.ContentConverter
    • BitmapConfiguration
    • BitmapHttpContentConverter
  • Dapplo.HttpExtensions.Wpf.ContentConverter
    • BitmapSourceConfiguration
    • BitmapSourceHttpContentConverter

Interface IChangeableHttpBehaviour

This interface extends the IHttpBehaviour but makes it possible to change the values. A use-case would be to call Clone on the IHttpBehaviour and modify the settings, return/assign the new value to a IHttpBehaviour This would be needed to pass the IHttpBehaviour via a CallContext.

Inherited Members
IHttpBehaviour.MakeCurrent()
IHttpBehaviour.ShallowClone()
Namespace: Dapplo.HttpExtensions
Assembly: Dapplo.HttpExtensions.dll
Syntax
public interface IChangeableHttpBehaviour : IHttpBehaviour

Properties

| Improve this Doc View Source

CookieContainer

This cookie container will be assed when creating the HttpMessageHandler and UseCookies is true

Declaration
CookieContainer CookieContainer { get; set; }
Property Value
Type Description
CookieContainer
| Improve this Doc View Source

DefaultEncoding

The default encoding which is used wherever an encoding is specified. The default is set to Encoding.UTF8

Declaration
Encoding DefaultEncoding { get; set; }
Property Value
Type Description
Encoding
| Improve this Doc View Source

DownloadProgress

Action which is called to notify of download progress. Only used when using non-string content like Bitmaps or MemoryStreams. Also the UseProgressStream needs to be true for this download progress

Declaration
Action<float> DownloadProgress { get; set; }
Property Value
Type Description
Action<System.Single>
| Improve this Doc View Source

HttpCompletionOption

This can be used to change the behaviour of Http operation, default is to read the complete response.

Declaration
HttpCompletionOption HttpCompletionOption { get; set; }
Property Value
Type Description
HttpCompletionOption
| Improve this Doc View Source

HttpContentConverters

This is the list of IHttpContentConverters which is used when converting from/to HttpContent

Declaration
IList<IHttpContentConverter> HttpContentConverters { get; set; }
Property Value
Type Description
IList<IHttpContentConverter>
| Improve this Doc View Source

HttpSettings

Pass your HttpSettings here, which will be used to create the HttpClient If not specified, the HttpSettings.GlobalSettings will be used

Declaration
IHttpSettings HttpSettings { get; set; }
Property Value
Type Description
IHttpSettings
| Improve this Doc View Source

JsonSerializer

This is used to de- serialize Json, can be overwritten by your own implementation. By default, also when empty, the SimpleJsonSerializer is used.

Declaration
IJsonSerializer JsonSerializer { get; set; }
Property Value
Type Description
IJsonSerializer
| Improve this Doc View Source

OnHttpClientCreated

An action which can modify the HttpClient which is generated in the HttpClientFactory. Use cases for this, might be adding a header or other settings for specific cases

Declaration
Action<HttpClient> OnHttpClientCreated { get; set; }
Property Value
Type Description
Action<HttpClient>
| Improve this Doc View Source

OnHttpContentCreated

An Func which can modify the HttpContent right before it's used to start the request. This can be used to add a specific header, e.g. set a filename etc, or return a completely different HttpContent type

Declaration
Func<HttpContent, HttpContent> OnHttpContentCreated { get; set; }
Property Value
Type Description
Func<HttpContent, HttpContent>
| Improve this Doc View Source

OnHttpMessageHandlerCreated

An Func which can modify or wrap the HttpMessageHandler which is generated in the HttpMessageHandlerFactory. Use cases for this, might be if you have very specify settings which can't be set via the IHttpSettings Or you want to add additional behaviour (extend DelegatingHandler!!) like the OAuthDelegatingHandler

Declaration
Func<HttpMessageHandler, HttpMessageHandler> OnHttpMessageHandlerCreated { get; set; }
Property Value
Type Description
Func<HttpMessageHandler, HttpMessageHandler>
| Improve this Doc View Source

OnHttpRequestMessageCreated

An Func which can modify the HttpRequestMessage right before it's used to start the request. This can be used to add a specific header, which should not be for all requests. As the called func has access to HttpRequestMessage with the content, uri and method this is quite usefull, it can return a completely different HttpRequestMessage

Declaration
Func<HttpRequestMessage, HttpRequestMessage> OnHttpRequestMessageCreated { get; set; }
Property Value
Type Description
Func<HttpRequestMessage, HttpRequestMessage>
| Improve this Doc View Source

ReadBufferSize

Specify the buffer for reading operations

Declaration
int ReadBufferSize { get; set; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

RequestConfigurations

The IHttpBehaviour is used to control the behaviour of all operations in the HttpExtensions library.

Declaration
IDictionary<string, IHttpRequestConfiguration> RequestConfigurations { get; set; }
Property Value
Type Description
IDictionary<System.String, IHttpRequestConfiguration>
| Improve this Doc View Source

ThrowOnError

If a request gets a response which has a HTTP status code which is an error, it would normally THROW an exception. Sometimes you would still want the response, settings this to false would allow this. This can be ignored for all HttpResponse returning methods.

Declaration
bool ThrowOnError { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

UploadProgress

Action which is called to notify of upload progress. Only used when using non-string content like Bitmaps or MemoryStreams. Also the UseProgressStream needs to be true for this upload progress

Declaration
Action<float> UploadProgress { get; set; }
Property Value
Type Description
Action<System.Single>
| Improve this Doc View Source

UseProgressStream

Whenever a post is made to upload memorystream or bitmaps, this value is used to decide: true: ProgressStreamContent is used, instead of StreamContent

Declaration
bool UseProgressStream { get; set; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ValidateResponseContentType

Check if the response has the expected content-type, when servers are used that are not following specifications this should be set to false

Declaration
bool ValidateResponseContentType { get; set; }
Property Value
Type Description
System.Boolean

Extension Methods

HttpBehaviourExtensions.ChainOnHttpContentCreated(IChangeableHttpBehaviour, Func<HttpContent, HttpContent>)
HttpBehaviourExtensions.ChainOnHttpMessageHandlerCreated(IChangeableHttpBehaviour, Func<HttpMessageHandler, HttpMessageHandler>)
HttpBehaviourExtensions.ChainOnHttpRequestMessageCreated(IChangeableHttpBehaviour, Func<HttpRequestMessage, HttpRequestMessage>)
HttpBehaviourExtensions.GetConfig<THttpRequestConfiguration>(IHttpBehaviour)
HttpBehaviourExtensions.SetConfig(IHttpBehaviour, IHttpRequestConfiguration)
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © Dapplo