var httpContext = HttpContext.Current; // Using the static Current property
var httpContext = new DefaultHttpContext();
var request = httpContext.Request; var response = httpContext.Response;Package/library: Microsoft.AspNetCore.Http. This library is part of ASP.NET Core and provides a set of classes for handling HTTP requests and responses.