string cookieValue = Request.Cookies["myCookie"].Value;
string ipAddress = Request.HttpContext.Connection.RemoteIpAddress.ToString();
Response.Headers.Add("MyHeader", "SomeValue");This code adds a custom header named "MyHeader" to the current response with the value "SomeValue". Package library: Microsoft.AspNetCore.Http Overall, HttpContext is a powerful class that provides a wide range of functionalities for HTTP requests and responses in C#. The package libraries involved with this class include Microsoft.AspNetCore.Http.