C# Class CustomSender.WebHooks.MyWebHookSender

This class provide an example of how to customize the shape of custom WebHook requests sent to WebHook subscribers.
Inheritance: Microsoft.AspNet.WebHooks.DataflowWebHookSender
Exibir arquivo Open project: aspnet/WebHooks

Public Methods

Method Description
MyWebHookSender ( ILogger logger ) : System.Net.Http

Protected Methods

Method Description
CreateWebHookRequest ( WebHookWorkItem workItem ) : HttpRequestMessage

By overriding this method you can shape the WebHook request URI exactly as you want, both in terms of HTTP headers and HTTP body.

CreateWebHookRequestBody ( WebHookWorkItem workItem ) : Newtonsoft.Json.Linq.JObject

By overriding this method you can control just the WebHook request body. The rest of the WebHook request follows the default model including the HTTP header containing a signature of the body.

SignWebHookRequest ( WebHookWorkItem workItem, HttpRequestMessage request, Newtonsoft.Json.Linq.JObject body ) : void

By overriding this method you can control just the WebHook header containing a signature of the body.

Method Details

CreateWebHookRequest() protected method

By overriding this method you can shape the WebHook request URI exactly as you want, both in terms of HTTP headers and HTTP body.
protected CreateWebHookRequest ( WebHookWorkItem workItem ) : HttpRequestMessage
workItem Microsoft.AspNet.WebHooks.WebHookWorkItem
return System.Net.Http.HttpRequestMessage

CreateWebHookRequestBody() protected method

By overriding this method you can control just the WebHook request body. The rest of the WebHook request follows the default model including the HTTP header containing a signature of the body.
protected CreateWebHookRequestBody ( WebHookWorkItem workItem ) : Newtonsoft.Json.Linq.JObject
workItem Microsoft.AspNet.WebHooks.WebHookWorkItem
return Newtonsoft.Json.Linq.JObject

MyWebHookSender() public method

public MyWebHookSender ( ILogger logger ) : System.Net.Http
logger ILogger
return System.Net.Http

SignWebHookRequest() protected method

By overriding this method you can control just the WebHook header containing a signature of the body.
protected SignWebHookRequest ( WebHookWorkItem workItem, HttpRequestMessage request, Newtonsoft.Json.Linq.JObject body ) : void
workItem Microsoft.AspNet.WebHooks.WebHookWorkItem
request System.Net.Http.HttpRequestMessage
body Newtonsoft.Json.Linq.JObject
return void