1 write to HttpContext
Microsoft.AspNetCore.Mvc.Abstractions (1)
Formatters\OutputFormatterCanWriteContext.cs (1)
22HttpContext = httpContext;
90 references to HttpContext
BasicWebSite (4)
Formatters\CustomFormatter.cs (1)
36var response = context.HttpContext.Response;
Formatters\PlainTextFormatter.cs (1)
34var response = context.HttpContext.Response;
Formatters\VCardFormatter_V3.cs (1)
39await context.HttpContext.Response.WriteAsync(
Formatters\VCardFormatter_V4.cs (1)
42await context.HttpContext.Response.WriteAsync(
Microsoft.AspNetCore.Mvc.Abstractions (2)
Formatters\OutputFormatterCanWriteContext.cs (2)
17/// <param name="httpContext">The <see cref="HttpContext"/> for the current request.</param> 26/// Gets or sets the <see cref="HttpContext"/> context associated with the current operation.
Microsoft.AspNetCore.Mvc.Core (11)
Formatters\HttpNoContentOutputFormatter.cs (1)
36var response = context.HttpContext.Response;
Formatters\OutputFormatter.cs (1)
173var response = context.HttpContext.Response;
Formatters\StreamOutputFormatter.cs (1)
33var response = context.HttpContext.Response;
Formatters\StringOutputFormatter.cs (1)
54var response = context.HttpContext.Response;
Formatters\SystemTextJsonOutputFormatter.cs (2)
66var httpContext = context.HttpContext; 101catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested) { }
Formatters\TextOutputFormatter.cs (4)
131context.HttpContext.Response.StatusCode = statusCode; 133if (context.HttpContext.RequestServices.GetService<IProblemDetailsService>() is { } problemDetailsService) 137HttpContext = context.HttpContext, 172var request = context.HttpContext.Request;
Infrastructure\DefaultOutputFormatterSelector.cs (1)
72var request = context.HttpContext.Request;
Microsoft.AspNetCore.Mvc.Core.Test (15)
Formatters\JsonOutputFormatterTestBase.cs (1)
153var body = outputFormatterContext.HttpContext.Response.Body;
Formatters\NoContentFormatterTests.cs (2)
130Assert.Equal(StatusCodes.Status204NoContent, context.HttpContext.Response.StatusCode); 150Assert.Null(context.HttpContext.Response.ContentLength);
Formatters\TextOutputFormatterTests.cs (2)
206Assert.Equal(MediaTypeHeaderValue.Parse(testContentType.Value), context.HttpContext.Response.GetTypedHeaders().ContentType); 231Assert.Equal(StatusCodes.Status406NotAcceptable, context.HttpContext.Response.StatusCode);
Infrastructure\ControllerActionInvokerTest.cs (1)
1728await c.HttpContext.Response.WriteAsync(c.Object.ToString());
Infrastructure\DefaultApiProblemDetailsWriterTest.cs (1)
245return context.HttpContext.Response.WriteAsJsonAsync(context.Object);
Infrastructure\DefaultOutputFormatterSelectorTest.cs (8)
33context.HttpContext.Request.Headers.Accept = "application/xml"; // This will not be used 63context.HttpContext.Request.Headers.Accept = "application/xml"; // This will not be used 92context.HttpContext.Request.Headers.Accept = "application/xml"; // This will not be used 163context.HttpContext.Request.Headers.Accept = acceptHeader; 222context.HttpContext.Request.Headers.Accept = "text/custom,application/custom"; 257context.HttpContext.Request.Headers.Accept = "text/custom,application/custom"; 286context.HttpContext.Request.Headers.Accept = "text/custom"; 315context.HttpContext.Request.Headers.Accept = "text/custom, text/custom2";
Microsoft.AspNetCore.Mvc.Formatters.Xml (6)
XmlDataContractSerializerOutputFormatter.cs (3)
221var httpContext = context.HttpContext; 234value = await reader(value, context.HttpContext.RequestAborted); 236if (context.HttpContext.RequestAborted.IsCancellationRequested)
XmlSerializerOutputFormatter.cs (3)
200var httpContext = context.HttpContext; 212value = await reader(value, context.HttpContext.RequestAborted); 214if (context.HttpContext.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Mvc.Formatters.Xml.Test (36)
XmlDataContractSerializerOutputFormatterTest.cs (18)
108var body = outputFormatterContext.HttpContext.Response.Body; 172var body = formatterContext.HttpContext.Response.Body; 197var body = outputFormatterContext.HttpContext.Response.Body; 232var body = outputFormatterContext.HttpContext.Response.Body; 263var body = outputFormatterContext.HttpContext.Response.Body; 291var body = outputFormatterContext.HttpContext.Response.Body; 319var body = outputFormatterContext.HttpContext.Response.Body; 340var body = outputFormatterContext.HttpContext.Response.Body; 354var response = outputFormatterContext.HttpContext.Response; 530var body = outputFormatterContext.HttpContext.Response.Body; 577var body = outputFormatterContext.HttpContext.Response.Body; 624var body = outputFormatterContext.HttpContext.Response.Body; 708outputFormatterContext.HttpContext.Request.QueryString = new QueryString("?indent=" + indent); 714var body = outputFormatterContext.HttpContext.Response.Body; 734outputFormatterContext.HttpContext.RequestAborted = cts.Token; 735outputFormatterContext.HttpContext.Response.Body = body; 772outputFormatterContext.HttpContext.Response.Body = body; 831var request = context.HttpContext.Request;
XmlSerializerOutputFormatterTest.cs (18)
62var body = outputFormatterContext.HttpContext.Response.Body; 92outputFormatterContext.HttpContext.Request.QueryString = new QueryString("?indent=" + indent); 98var body = outputFormatterContext.HttpContext.Response.Body; 118var body = outputFormatterContext.HttpContext.Response.Body; 174var body = formatterContext.HttpContext.Response.Body; 197var body = outputFormatterContext.HttpContext.Response.Body; 230var body = outputFormatterContext.HttpContext.Response.Body; 259var body = outputFormatterContext.HttpContext.Response.Body; 285var body = outputFormatterContext.HttpContext.Response.Body; 310var body = outputFormatterContext.HttpContext.Response.Body; 329Assert.NotNull(outputFormatterContext.HttpContext.Response.Body); 330Assert.True(outputFormatterContext.HttpContext.Response.Body.CanRead); 408var response = outputFormatterContext.HttpContext.Response; 414Assert.NotNull(outputFormatterContext.HttpContext.Response.ContentLength); 516outputFormatterContext.HttpContext.RequestAborted = cts.Token; 517outputFormatterContext.HttpContext.Response.Body = body; 554outputFormatterContext.HttpContext.Response.Body = body; 621var request = context.HttpContext.Request;
Microsoft.AspNetCore.Mvc.NewtonsoftJson (6)
NewtonsoftJsonOutputFormatter.cs (6)
140_jsonOptions ??= context.HttpContext.RequestServices.GetRequiredService<IOptions<MvcNewtonsoftJsonOptions>>().Value; 142var response = context.HttpContext.Response; 155var logger = context.HttpContext.RequestServices.GetRequiredService<ILogger<NewtonsoftJsonOutputFormatter>>(); 159value = await reader(value, context.HttpContext.RequestAborted); 161catch (OperationCanceledException) when (context.HttpContext.RequestAborted.IsCancellationRequested) { } 163if (context.HttpContext.RequestAborted.IsCancellationRequested)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (10)
NewtonsoftJsonOutputFormatterTest.cs (9)
67outputFormatterContext.HttpContext.RequestServices = services; 139var body = outputFormatterContext.HttpContext.Response.Body; 171var body = outputFormatterContext2.HttpContext.Response.Body; 214var body = context.HttpContext.Response.Body; 266var body = context.HttpContext.Response.Body; 302var body = context.HttpContext.Response.Body; 337var body = context.HttpContext.Response.Body; 397Assert.NotNull(outputFormatterContext.HttpContext.Response.ContentLength); 424var body = context.HttpContext.Response.Body;
src\Mvc\Mvc.Core\test\Formatters\JsonOutputFormatterTestBase.cs (1)
153var body = outputFormatterContext.HttpContext.Response.Body;