Class HttpLayoutRequestHandler
- Namespace
- Sitecore.AspNetCore.SDK.LayoutService.Client.Request.Handlers
- Assembly
- Sitecore.AspNetCore.SDK.LayoutService.Client.dll
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
public class HttpLayoutRequestHandler : ILayoutRequestHandler
- Inheritance
-
HttpLayoutRequestHandler
- Implements
- Inherited Members
Constructors
HttpLayoutRequestHandler(HttpClient, ISitecoreLayoutSerializer, IOptionsSnapshot<HttpLayoutRequestHandlerOptions>, ILogger<HttpLayoutRequestHandler>)
Initializes a new instance of the HttpLayoutRequestHandler class.
public HttpLayoutRequestHandler(HttpClient client, ISitecoreLayoutSerializer serializer, IOptionsSnapshot<HttpLayoutRequestHandlerOptions> options, ILogger<HttpLayoutRequestHandler> logger)
Parameters
client
HttpClientThe HttpClient to handle requests.
serializer
ISitecoreLayoutSerializerThe serializer to handle response data.
options
IOptionsSnapshot<HttpLayoutRequestHandlerOptions>An IOptionsSnapshot<TOptions> to access specific options for this instance.
logger
ILogger<HttpLayoutRequestHandler>The ILogger to use for logging.
Methods
BuildMessage(SitecoreLayoutRequest, HttpLayoutRequestHandlerOptions?)
Build a new HttpRequestMessage using the layout request and handler options provided.
protected virtual HttpRequestMessage BuildMessage(SitecoreLayoutRequest request, HttpLayoutRequestHandlerOptions? options)
Parameters
request
SitecoreLayoutRequestoptions
HttpLayoutRequestHandlerOptions
Returns
- HttpRequestMessage
A configured HttpRequestMessage.
GetResponseAsync(HttpRequestMessage)
Get the HttpResponseMessage returned by the provided URI.
protected virtual Task<HttpResponseMessage> GetResponseAsync(HttpRequestMessage message)
Parameters
message
HttpRequestMessageThe HttpRequestMessage to be sent to the provided URI.
Returns
Request(SitecoreLayoutRequest, string)
Handles a request to the Sitecore layout service using the specified handler.
public Task<SitecoreLayoutResponse> Request(SitecoreLayoutRequest request, string handlerName)
Parameters
request
SitecoreLayoutRequestThe request details.
handlerName
stringThe name of the request handler to use to handle the request.
Returns
- Task<SitecoreLayoutResponse>
The response of the request.