Class HttpLayoutRequestHandler
Version: 21.x
Supports making requests to the Sitecore layout service.
Inheritance
System.Object
HttpLayoutRequestHandler
Implements
Namespace: Sitecore.LayoutService.Client.RequestHandlers
Assembly: Sitecore.LayoutService.Client.dll
Syntax
Constructors
HttpLayoutRequestHandler(HttpClient, ISitecoreLayoutSerializer, IOptionsSnapshot, ILogger)
Initializes a new instance of the HttpLayoutRequestHandler class.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Net.Http.HttpClient | client | The System.Net.Http.HttpClient to handle requests. |
| ISitecoreLayoutSerializer | serializer | The serializer to handle response data. |
| Microsoft.Extensions.Options.IOptionsSnapshot < HttpLayoutRequestHandlerOptions > | options | An Microsoft.Extensions.Options.IOptionsSnapshot<> to access specific options for this instance. |
| Microsoft.Extensions.Logging.ILogger < HttpLayoutRequestHandler > | logger | The Microsoft.Extensions.Logging.ILogger to use for logging. |
Methods
BuildMessage(SitecoreLayoutRequest, HttpLayoutRequestHandlerOptions)
Build a new System.Net.Http.HttpRequestMessage using the layout request and handler options provided.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| SitecoreLayoutRequest | request | The SitecoreLayoutRequest. |
| HttpLayoutRequestHandlerOptions | options | The HttpLayoutRequestHandlerOptions. |
Returns
| Type | Description |
|---|---|
| System.Net.Http.HttpRequestMessage | A configured System.Net.Http.HttpRequestMessage. |
GetResponseAsync(HttpRequestMessage)
Get the System.Net.Http.HttpResponseMessage returned by the provided URI.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Net.Http.HttpRequestMessage | message | The System.Net.Http.HttpRequestMessage to be sent to the provided URI. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task < System.Net.Http.HttpResponseMessage > | A System.Net.Http.HttpResponseMessage. |
Request(SitecoreLayoutRequest, String)
Handles a request to the Sitecore layout service using the specified handler.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| SitecoreLayoutRequest | request | The request details. |
| System.String | handlerName | The name of the request handler to use to handle the request. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task < SitecoreLayoutResponse > | The response of the request. |
Implements
If you have suggestions for improving this article, let us know!