Class HttpContextExtensions
Version: 21.x
Http context extensions.
Inheritance
System.Object
HttpContextExtensions
Namespace: Sitecore.AspNet.RenderingEngine.Extensions
Assembly: Sitecore.AspNet.RenderingEngine.dll
Syntax
Methods
AppendValue(IDictionary<String, String[]>, String, String)
Extension method for collection manipulation simplifications. It insert/appends string value to dictinary item. Is usefull for headers manipulations.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IDictionary < System.String , System.String []> | collection | Destination collection. |
| System.String | key | Key name. |
| System.String | value | Value to be added to values array. |
CopyHeader(IEnumerable<KeyValuePair<String, StringValues>>, String, IDictionary<String, String[]>)
Extension method for copying of Http headers.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Collections.Generic.IEnumerable < System.Collections.Generic.KeyValuePair < System.String , Microsoft.Extensions.Primitives.StringValues >> | source | Source collection. |
| System.String | headerKey | Header name to copy. |
| System.Collections.Generic.IDictionary < System.String , System.String []> | destination | Destination collection. |
CopyHeader(ILookup<String, String>, String, IDictionary<String, String[]>)
Extension method for copying of Http headers.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Linq.ILookup < System.String , System.String > | source | Source collection. |
| System.String | headerKey | Header name to copy. |
| System.Collections.Generic.IDictionary < System.String , System.String []> | destination | Destination collection. |
UpdateResponseWithLayoutMetadata(ISitecoreRenderingContext, HttpContext)
Updates response with meta data from sitecore rendering context.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| ISitecoreRenderingContext | renderingContext | Sitecore rendering context. |
| Microsoft.AspNetCore.Http.HttpContext | context | Http context. |
If you have suggestions for improving this article, let us know!