This documentation is also published as Markdown for efficient machine reading: the whole site is indexed at /llms.txt, and every page has a clean Markdown copy under /_llms/. These are generated from the same source and cost far fewer tokens to read than this rendered HTML.

Skip to main content Skip to navigation

IInProcessHttpDispatcher Pennington.Infrastructure

Dispatches HTTP requests against the running app's pipeline. Replaces the "self-fetch via Kestrel socket" pattern with a transport that the host can satisfy in-process (via Microsoft.AspNetCore.TestHost.TestServer) or over the wire (via Kestrel's listening address) depending on which IServer is registered.

Internal services (LlmsTxtService, SearchArtifactService, build crawler) take this instead of IHttpClientFactory so they don't need to know whether the host is using TestServer (build / tests) or Kestrel (dev). The middleware pipeline runs identically either way — the only difference is who delivers the bytes.

Methods

CreateClient

#
public HttpClient CreateClient()

Returns an HttpClient whose requests flow through the running app's pipeline.

Returns

HttpClient

Pennington.Infrastructure.IInProcessHttpDispatcher

namespace Pennington.Infrastructure;

/// Dispatches HTTP requests against the running app's pipeline. Replaces the "self-fetch via Kestrel socket" pattern with a transport that the host can satisfy in-process (via Microsoft.AspNetCore.TestHost.TestServer) or over the wire (via Kestrel's listening address) depending on which IServer is registered. Internal services (LlmsTxtService, SearchArtifactService, build crawler) take this instead of IHttpClientFactory so they don't need to know whether the host is using TestServer (build / tests) or Kestrel (dev). The middleware pipeline runs identically either way — the only difference is who delivers the bytes.
public interface IInProcessHttpDispatcher
{
    /// Returns an HttpClient whose requests flow through the running app's pipeline.
    
public HttpClient CreateClient()
; }