Class HttpListenerContextExtensions
Extensions for the HttpListener
Inheritance
System.Object
HttpListenerContextExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Dapplo.HttpExtensions.Listener
Assembly: Dapplo.HttpExtensions.dll
Syntax
public static class HttpListenerContextExtensions
Methods
| Improve this Doc View SourceRespondAsync<TContent>(HttpListenerContext, TContent, CancellationToken)
This writes the supplied content to the response of the httpListenerContext It's actually a bit overkill, as it converts to HttpContent and writes this to a stream But performance and memory usage are currently not our main concern for the HttpListener
Declaration
public static async Task RespondAsync<TContent>(this HttpListenerContext httpListenerContext, TContent content, CancellationToken cancellationToken = null)
where TContent : class
Parameters
Type | Name | Description |
---|---|---|
HttpListenerContext | httpListenerContext | HttpListenerContext |
TContent | content | TContent object |
CancellationToken | cancellationToken | CancellationToken |
Returns
Type | Description |
---|---|
Task | Task |
Type Parameters
Name | Description |
---|---|
TContent | Type of the content |