This HTTP server can be used to mock the HTTP responses, requested by your client that you are testing.
The code is based on the System.Net.HttpListener class and this example.
There is also the accompanied extension methods so that you can easily and in a fluent way, configure the HTTP responses for each request.
using var httpServer = new MockHttpServer(18080);
httpServer.Start();
httpServer
.ForGetRequest("/items/1")
.RespondWithOkJson(new { Id = 1, Hello = "World" });
var httpClient = new HttpClient();
var responseBody = await client.GetStringAsync($"{httpServer.BaseAddress}items/1");
// responseBody should be the JSON formatted string: {"Id":1,"Hello":"World"}