C# Class Microsoft.AspNet.WebHooks.WebHookSender

Provides a base implementation of IWebHookSender that defines the default format for HTTP requests sent as WebHooks.
Inheritance: IWebHookSender, IDisposable
Show file Open project: aspnet/WebHooks Class Usage Examples

Public Methods

Method Description
Dispose ( ) : void
SendWebHookWorkItemsAsync ( IEnumerable workItems ) : System.Threading.Tasks.Task

Protected Methods

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

Creates a JObject used as the HttpRequestMessage entity body for a WebHook.

Dispose ( bool disposing ) : void

Releases the unmanaged resources and optionally releases the managed resources.

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

Adds a SHA 256 signature to the body and adds it to the request as an HTTP header to the HttpRequestMessage along with the entity body.

WebHookSender ( ILogger logger ) : System

Initializes a new instance of the WebHookSender class.

Private Methods

Method Description
CreateWebHookRequest ( WebHookWorkItem workItem ) : HttpRequestMessage

Method Details

CreateWebHookRequestBody() protected method

Creates a JObject used as the HttpRequestMessage entity body for a WebHook.
protected CreateWebHookRequestBody ( WebHookWorkItem workItem ) : Newtonsoft.Json.Linq.JObject
workItem WebHookWorkItem The representing the data to be sent.
return Newtonsoft.Json.Linq.JObject

Dispose() public method

public Dispose ( ) : void
return void

Dispose() protected method

Releases the unmanaged resources and optionally releases the managed resources.
protected Dispose ( bool disposing ) : void
disposing bool true to release both managed and unmanaged resources; false to release only unmanaged resources.
return void

SendWebHookWorkItemsAsync() public abstract method

public abstract SendWebHookWorkItemsAsync ( IEnumerable workItems ) : System.Threading.Tasks.Task
workItems IEnumerable
return System.Threading.Tasks.Task

SignWebHookRequest() protected method

Adds a SHA 256 signature to the body and adds it to the request as an HTTP header to the HttpRequestMessage along with the entity body.
protected SignWebHookRequest ( WebHookWorkItem workItem, HttpRequestMessage request, Newtonsoft.Json.Linq.JObject body ) : void
workItem WebHookWorkItem The current .
request System.Net.Http.HttpRequestMessage The request to add the signature to.
body Newtonsoft.Json.Linq.JObject The body to sign and add to the request.
return void

WebHookSender() protected method

Initializes a new instance of the WebHookSender class.
protected WebHookSender ( ILogger logger ) : System
logger ILogger
return System