1 override of ContentType
Microsoft.AspNetCore.Http (1)
Internal\DefaultHttpResponse.cs (1)
93public override string? ContentType
72 writes to ContentType
Aspire.Dashboard (4)
DashboardEndpointsBuilder.cs (1)
236httpContext.Response.ContentType = "application/x-ndjson";
Otlp\Http\OtlpHttpEndpointsBuilder.cs (3)
110httpContext.Response.ContentType = JsonContentType; 228httpContext.Response.ContentType = ProtobufContentType; 232httpContext.Response.ContentType = JsonContentType;
Microsoft.AspNetCore.Components.Endpoints (5)
Builder\ResourceCollectionUrlEndpoint.cs (1)
274context.Response.ContentType = "application/javascript";
RazorComponentEndpointInvoker.cs (2)
45context.Response.ContentType = RazorComponentResultExecutor.DefaultContentType; 190context.Response.ContentType = null;
Rendering\EndpointHtmlRenderer.EventDispatch.cs (1)
76_httpContext.Response.ContentType = "text/plain";
Results\RazorComponentResultExecutor.cs (1)
27response.ContentType = result.ContentType ?? DefaultContentType;
Microsoft.AspNetCore.Diagnostics (7)
DeveloperExceptionPage\DeveloperExceptionPageMiddlewareImpl.cs (1)
233httpContext.Response.ContentType = "text/plain; charset=utf-8";
DeveloperExceptionPage\Views\CompilationErrorPage.Designer.cs (1)
58Response.ContentType = "text/html; charset=utf-8";
DeveloperExceptionPage\Views\ErrorPage.Designer.cs (1)
65Response.ContentType = "text/html; charset=utf-8";
StatusCodePage\StatusCodePagesExtensions.cs (1)
87context.HttpContext.Response.ContentType = contentType;
StatusCodePage\StatusCodePagesOptions.cs (1)
36context.HttpContext.Response.ContentType = "text/plain";
WelcomePage\Views\Obsolete\WelcomePage.cs (1)
30Response.ContentType = "text/html";
WelcomePage\Views\WelcomePage.Designer.cs (1)
29Response.ContentType = "text/html; charset=utf-8";
Microsoft.AspNetCore.Diagnostics.HealthChecks (1)
HealthCheckResponseWriters.cs (1)
18httpContext.Response.ContentType = "text/plain";
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Logging\AcceptanceTests.cs (2)
116context.Response.ContentType = MediaTypeNames.Text.Plain; 133context.Response.ContentType = MediaTypeNames.Text.Plain;
Microsoft.AspNetCore.HostFiltering (1)
HostFilteringMiddleware.cs (1)
73context.Response.ContentType = "text/html";
Microsoft.AspNetCore.Hosting (1)
Internal\ErrorPageBuilder.cs (1)
33context.Response.ContentType = "text/html; charset=utf-8";
Microsoft.AspNetCore.Http.Connections (27)
Internal\HttpConnectionContext.cs (5)
462nonClonedContext.Response.ContentType = "application/octet-stream"; 518nonClonedContext.Response.ContentType = "text/plain"; 528nonClonedContext.Response.ContentType = "text/plain"; 561context.Response.ContentType = "text/plain"; 575context.Response.ContentType = "text/plain";
Internal\HttpConnectionDispatcher.cs (15)
97context.Response.ContentType = "text/plain"; 116context.Response.ContentType = "text/plain"; 339context.Response.ContentType = "application/json"; 459context.Response.ContentType = "text/plain"; 481context.Response.ContentType = "text/plain"; 499context.Response.ContentType = "text/plain"; 508context.Response.ContentType = "text/plain"; 525context.Response.ContentType = "text/plain"; 557context.Response.ContentType = "text/plain"; 568context.Response.ContentType = "text/plain"; 575context.Response.ContentType = "text/plain"; 592context.Response.ContentType = "text/plain"; 596context.Response.ContentType = "text/plain"; 786context.Response.ContentType = "text/plain"; 796context.Response.ContentType = "text/plain";
Internal\Transports\LongPollingServerTransport.cs (6)
44context.Response.ContentType = "text/plain"; 55context.Response.ContentType = "application/octet-stream"; 87context.Response.ContentType = "text/plain"; 93context.Response.ContentType = "text/plain"; 101context.Response.ContentType = "text/plain"; 108context.Response.ContentType = "text/plain";
Internal\Transports\ServerSentEventsServerTransport.cs (1)
33context.Response.ContentType = "text/event-stream";
Microsoft.AspNetCore.Http.Extensions (6)
HttpResponseJsonExtensions.cs (5)
91response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset; 122response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset; 164response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset; 270response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset; 321response.ContentType = contentType ?? ContentTypeConstants.JsonContentTypeWithCharset;
src\aspnetcore\src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
33httpContext.Response.ContentType ??= "text/plain; charset=utf-8";
Microsoft.AspNetCore.Http.Results (4)
HttpResultsHelper.cs (1)
84response.ContentType = resolvedContentType;
ServerSentEventsResult.cs (1)
43httpContext.Response.ContentType = "text/event-stream";
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (1)
126response.ContentType = result.ContentType;
Utf8ContentHttpResult.cs (1)
65httpContext.Response.ContentType = ContentType ?? ContentTypeConstants.DefaultContentType;
Microsoft.AspNetCore.Mvc.Core (5)
Formatters\OutputFormatter.cs (1)
174response.ContentType = context.ContentType.Value ?? string.Empty;
Formatters\StreamOutputFormatter.cs (1)
37response.ContentType = context.ContentType.ToString();
Infrastructure\ContentResultExecutor.cs (1)
49response.ContentType = resolvedContentType;
Infrastructure\SystemTextJsonResultExecutor.cs (1)
51response.ContentType = resolvedContentType;
src\aspnetcore\src\Shared\ResultsHelpers\FileResultHelper.cs (1)
126response.ContentType = result.ContentType;
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponentResultExecutor.cs (1)
94response.ContentType = resolvedContentType;
ViewExecutor.cs (1)
197response.ContentType = resolvedContentType;
Microsoft.AspNetCore.Rewrite (1)
UrlActions\CustomResponseAction.cs (1)
38response.ContentType = "text/plain; charset=utf-8";
Microsoft.AspNetCore.Routing (2)
src\aspnetcore\src\Shared\RouteHandlers\ExecuteHandlerHelper.cs (1)
33httpContext.Response.ContentType ??= "text/plain; charset=utf-8";
ValidationEndpointFilterFactory.cs (1)
121context.HttpContext.Response.ContentType = MediaTypeNames.Application.ProblemJson;
Microsoft.AspNetCore.StaticAssets (1)
StaticAssetsInvoker.cs (1)
97context.Response.ContentType = _contentType;
Microsoft.AspNetCore.StaticFiles (2)
HtmlDirectoryFormatter.cs (1)
40context.Response.ContentType = TextHtmlUtf8;
StaticFileContext.cs (1)
256_response.ContentType = _contentType;
Microsoft.DotNet.HotReload.Watch (1)
src\sdk\src\Dotnet.Watch\AspireService\AspireServerService.cs (1)
382response.ContentType = "text/plain";
22 references to ContentType
Microsoft.AspNetCore.Diagnostics (1)
StatusCodePage\StatusCodePagesMiddleware.cs (1)
77|| !string.IsNullOrEmpty(context.Response.ContentType))
Microsoft.AspNetCore.Hosting (3)
Internal\HostingRequestFinishedLog.cs (3)
372 => new KeyValuePair<string, object?>(nameof(response.ContentType), response.ContentType), 66_cachedToString = $"Request finished {request.Protocol} {request.Method} {request.Scheme}://{request.Host.Value}{request.PathBase.Value}{request.Path.Value}{request.QueryString.Value} - {response.StatusCode.ToString(CultureInfo.InvariantCulture)} {ValueOrEmptyMarker(response.ContentLength)} {EscapedValueOrEmptyMarker(response.ContentType)} {Elapsed.TotalMilliseconds.ToString("0.0000", CultureInfo.InvariantCulture)}ms";
Microsoft.AspNetCore.Http (2)
src\aspnetcore\src\Shared\Debugger\HttpContextDebugFormatter.cs (2)
23if (!string.IsNullOrEmpty(response.ContentType)) 26sb.Append(response.ContentType);
Microsoft.AspNetCore.Http.Abstractions (3)
HttpResponse.cs (1)
178public string? ContentType => _response.ContentType;
src\aspnetcore\src\Shared\Debugger\HttpContextDebugFormatter.cs (2)
23if (!string.IsNullOrEmpty(response.ContentType)) 26sb.Append(response.ContentType);
Microsoft.AspNetCore.Http.Results (2)
HttpResultsHelper.cs (1)
78response.ContentType,
src\aspnetcore\src\Shared\ResponseContentTypeHelper.cs (1)
17/// 2. <see cref="HttpResponse.ContentType"/> property set on <see cref="HttpResponse"/>
Microsoft.AspNetCore.HttpLogging (1)
ResponseBufferingStream.cs (1)
173if (MediaTypeHelpers.TryGetEncodingForMediaType(_logContext.HttpContext.Response.ContentType,
Microsoft.AspNetCore.Mvc.Core (5)
Formatters\FormatFilter.cs (1)
151!string.IsNullOrEmpty(context.HttpContext.Response.ContentType))
Infrastructure\ContentResultExecutor.cs (1)
43response.ContentType,
Infrastructure\ObjectResultExecutor.cs (1)
144var responseContentType = context.HttpContext.Response.ContentType;
Infrastructure\SystemTextJsonResultExecutor.cs (1)
45response.ContentType,
src\aspnetcore\src\Shared\ResponseContentTypeHelper.cs (1)
17/// 2. <see cref="HttpResponse.ContentType"/> property set on <see cref="HttpResponse"/>
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponentResultExecutor.cs (1)
88response.ContentType,
ViewExecutor.cs (1)
191response.ContentType,
Microsoft.AspNetCore.ResponseCompression (1)
ResponseCompressionProvider.cs (1)
189var mimeType = context.Response.ContentType;
Microsoft.AspNetCore.Watch.BrowserRefresh (2)
src\sdk\src\Dotnet.Watch\Web.Middleware\ResponseStreamWrapper.cs (2)
108MediaTypeHeaderValue.TryParse(response.ContentType, out var mediaType) && 114BrowserRefreshMiddleware.Log.ScriptInjectionSkipped(_logger, response.StatusCode, response.ContentType);