107 references to ContentType
CodeGenerator (2)
src\Servers\Kestrel\shared\KnownHeaders.cs (2)
103HeaderNames.ContentType, 119HeaderNames.ContentType,
IIS.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
533Assert.True(response.Content.Headers.TryGetValues(Net.Http.Headers.HeaderNames.ContentType, out headerValues));
IISExpress.FunctionalTests (1)
src\Servers\IIS\IIS\test\Common.FunctionalTests\RequestResponseTests.cs (1)
533Assert.True(response.Content.Headers.TryGetValues(Net.Http.Headers.HeaderNames.ContentType, out headerValues));
InMemory.FunctionalTests (10)
Http2\Http2ConnectionTests.cs (3)
175new KeyValuePair<string, string>(HeaderNames.ContentType, "application/json") 227new KeyValuePair<string, string>(HeaderNames.ContentType, "application/json") 321new KeyValuePair<string, string>(HeaderNames.ContentType, "application/json")
Http2\Http2StreamTests.cs (1)
2216Assert.Equal("Custom 你好 Type", _decodedHeaders[HeaderNames.ContentType]);
Http3\Http3ConnectionTests.cs (3)
419new KeyValuePair<string, string>(HeaderNames.ContentType, "application/json"), 457new KeyValuePair<string, string>(HeaderNames.ContentType, "application/json") 558new KeyValuePair<string, string>(HeaderNames.ContentType, "application/json")
Http3\Http3StreamTests.cs (3)
758new KeyValuePair<string, string>(HeaderNames.ContentType, "application/json") 792new KeyValuePair<string, string>(HeaderNames.ContentType, "application/json") 910Assert.Equal("Custom 你好 Type", responseHeaders[HeaderNames.ContentType]);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Logging\HeaderReaderTests.cs (1)
53[HeaderNames.ContentType] = MediaTypeNames.Application.Pdf
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
Internal\GrpcProtocolConstants.cs (1)
20HeaderNames.ContentType,
Microsoft.AspNetCore.HeaderParsing (1)
CommonHeaders.cs (1)
50public static HeaderSetup<MediaTypeHeaderValue> ContentType => new(HeaderNames.ContentType, MediaTypeHeaderValueParser.Instance, cacheable: true);
Microsoft.AspNetCore.HeaderParsing.Tests (1)
CommonHeadersTests.cs (1)
63Assert.Equal(HeaderNames.ContentType, CommonHeaders.ContentType.HeaderName);
Microsoft.AspNetCore.Http.Extensions (4)
RequestHeaders.cs (2)
158return Headers.Get<MediaTypeHeaderValue>(HeaderNames.ContentType); 162Headers.Set(HeaderNames.ContentType, value);
ResponseHeaders.cs (2)
98return Headers.Get<MediaTypeHeaderValue>(HeaderNames.ContentType); 102Headers.Set(HeaderNames.ContentType, value);
Microsoft.AspNetCore.Http.Extensions.Tests (3)
HeaderDictionaryTypeExtensionsTest.cs (3)
16var result = context.Request.GetTypedHeaders().Get<MediaTypeHeaderValue>(HeaderNames.ContentType); 27var result = context.Request.GetTypedHeaders().Get<MediaTypeHeaderValue>(HeaderNames.ContentType); 38var result = context.Request.GetTypedHeaders().Get<MediaTypeHeaderValue>(HeaderNames.ContentType);
Microsoft.AspNetCore.Http.Features (2)
IHeaderDictionary.Keyed.cs (2)
95StringValues ContentType { get => this[HeaderNames.ContentType]; set => this[HeaderNames.ContentType] = value; }
Microsoft.AspNetCore.Http.Results.Tests (4)
src\Shared\ResultsTests\FileContentResultTestBase.cs (1)
327Assert.False(httpResponse.Headers.ContainsKey(HeaderNames.ContentType));
src\Shared\ResultsTests\FileStreamResultTestBase.cs (1)
322Assert.False(httpResponse.Headers.ContainsKey(HeaderNames.ContentType));
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
262Assert.False(httpResponse.Headers.ContainsKey(HeaderNames.ContentType));
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
312Assert.False(httpResponse.Headers.ContainsKey(HeaderNames.ContentType));
Microsoft.AspNetCore.HttpLogging (2)
HttpLoggingOptions.cs (2)
43HeaderNames.ContentType, 83HeaderNames.ContentType,
Microsoft.AspNetCore.HttpLogging.Tests (1)
HttpLoggingMiddlewareTests.cs (1)
1187httpContext.Request.Headers.Remove(HeaderNames.ContentType);
Microsoft.AspNetCore.Mvc.Core.Test (4)
src\Shared\ResultsTests\FileContentResultTestBase.cs (1)
327Assert.False(httpResponse.Headers.ContainsKey(HeaderNames.ContentType));
src\Shared\ResultsTests\FileStreamResultTestBase.cs (1)
322Assert.False(httpResponse.Headers.ContainsKey(HeaderNames.ContentType));
src\Shared\ResultsTests\PhysicalFileResultTestBase.cs (1)
262Assert.False(httpResponse.Headers.ContainsKey(HeaderNames.ContentType));
src\Shared\ResultsTests\VirtualFileResultTestBase.cs (1)
312Assert.False(httpResponse.Headers.ContainsKey(HeaderNames.ContentType));
Microsoft.AspNetCore.OpenApi (1)
Services\OpenApiDocumentService.cs (1)
53private static readonly FrozenSet<string> _disallowedHeaderParameters = new[] { HeaderNames.Accept, HeaderNames.Authorization, HeaderNames.ContentType }.ToFrozenSet(StringComparer.OrdinalIgnoreCase);
Microsoft.AspNetCore.OutputCaching (1)
OutputCacheEntryFormatter.cs (1)
426HeaderNames.ContentType,
Microsoft.AspNetCore.Rewrite (1)
IISUrlRewrite\ServerVariables.cs (1)
37managedVariableThunk = () => new HeaderSegment(HeaderNames.ContentType);
Microsoft.AspNetCore.Server.HttpSys (9)
src\Shared\HttpSys\NativeInterop\HttpApiTypes.cs (1)
36HeaderNames.ContentType,
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
42HeaderNames.ContentEncoding, HeaderNames.ContentType, HeaderNames.ContentRange, HeaderNames.Trailer
src\Shared\HttpSys\RequestProcessing\RequestHeaders.Generated.cs (7)
1163if (string.Equals(key, HeaderNames.ContentType, StringComparison.OrdinalIgnoreCase)) 1392if (string.Equals(key, HeaderNames.ContentType, StringComparison.OrdinalIgnoreCase)) 1640if (string.Equals(key, HeaderNames.ContentType, StringComparison.OrdinalIgnoreCase)) 2002if (string.Equals(key, HeaderNames.ContentType, StringComparison.Ordinal)) 2259yield return HeaderNames.ContentType; 2595yield return new KeyValuePair<string, StringValues>(HeaderNames.ContentType, ContentType); 2764HttpSysRequestHeader.ContentType => HeaderNames.ContentType,
Microsoft.AspNetCore.Server.HttpSys.Tests (8)
RequestHeaderTests.cs (8)
36Assert.Contains(HeaderNames.ContentType, requestHeaders.Keys); 57Assert.Contains(HeaderNames.ContentType, requestHeaders.Keys); 157Assert.Contains(HeaderNames.ContentType, requestHeaders.Keys); 181Assert.Contains(HeaderNames.ContentType, requestHeaders.Keys); 287requestHeaders.Remove(HeaderNames.ContentType); 329Assert.Contains(HeaderNames.ContentType, requestHeaders.Keys); 331requestHeaders.Remove(HeaderNames.ContentType); 333Assert.DoesNotContain(HeaderNames.ContentType, requestHeaders.Keys);
Microsoft.AspNetCore.Server.IIS (9)
src\Shared\HttpSys\NativeInterop\HttpApiTypes.cs (1)
36HeaderNames.ContentType,
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
42HeaderNames.ContentEncoding, HeaderNames.ContentType, HeaderNames.ContentRange, HeaderNames.Trailer
src\Shared\HttpSys\RequestProcessing\RequestHeaders.Generated.cs (7)
1163if (string.Equals(key, HeaderNames.ContentType, StringComparison.OrdinalIgnoreCase)) 1392if (string.Equals(key, HeaderNames.ContentType, StringComparison.OrdinalIgnoreCase)) 1640if (string.Equals(key, HeaderNames.ContentType, StringComparison.OrdinalIgnoreCase)) 2002if (string.Equals(key, HeaderNames.ContentType, StringComparison.Ordinal)) 2259yield return HeaderNames.ContentType; 2595yield return new KeyValuePair<string, StringValues>(HeaderNames.ContentType, ContentType); 2764HttpSysRequestHeader.ContentType => HeaderNames.ContentType,
Microsoft.AspNetCore.Server.Kestrel.Core (28)
Internal\Http\HttpHeaders.Generated.cs (28)
313HeaderNames.ContentType, 3186if (ReferenceEquals(HeaderNames.ContentType, key)) 3214if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase)) 4015if (ReferenceEquals(HeaderNames.ContentType, key)) 4034if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase)) 4962if (ReferenceEquals(HeaderNames.ContentType, key)) 4993if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase)) 6069if (ReferenceEquals(HeaderNames.ContentType, key)) 6100if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase)) 7190array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.ContentType, _headers._ContentType); 7731nameStr = HeaderNames.ContentType; 8004nameStr = HeaderNames.ContentType; 8246nameStr = HeaderNames.ContentType; 8494_current = new KeyValuePair<string, StringValues>(HeaderNames.ContentType, _collection._headers._ContentType); 8861ValidateHeaderValueCharacters(HeaderNames.ContentType, value, EncodingSelector); 11264if (ReferenceEquals(HeaderNames.ContentType, key)) 11274if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase)) 11965if (ReferenceEquals(HeaderNames.ContentType, key)) 11972if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase)) 12698if (ReferenceEquals(HeaderNames.ContentType, key)) 12709if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase)) 13590if (ReferenceEquals(HeaderNames.ContentType, key)) 13601if (HeaderNames.ContentType.Equals(key, StringComparison.OrdinalIgnoreCase)) 14463array[arrayIndex] = new KeyValuePair<string, StringValues>(HeaderNames.ContentType, _headers._ContentType); 15260_current = new KeyValuePair<string, StringValues>(HeaderNames.ContentType, _collection._headers._ContentType); 16127if (!TryGetUnknown(HeaderNames.ContentType, ref value)) 16136ValidateHeaderValueCharacters(HeaderNames.ContentType, value, EncodingSelector); 16137SetValueUnknown(HeaderNames.ContentType, value);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
src\Servers\Kestrel\shared\KnownHeaders.cs (2)
103HeaderNames.ContentType, 119HeaderNames.ContentType,
Microsoft.AspNetCore.Shared.Tests (9)
src\Shared\HttpSys\NativeInterop\HttpApiTypes.cs (1)
36HeaderNames.ContentType,
src\Shared\HttpSys\RequestProcessing\HeaderCollection.cs (1)
42HeaderNames.ContentEncoding, HeaderNames.ContentType, HeaderNames.ContentRange, HeaderNames.Trailer
src\Shared\HttpSys\RequestProcessing\RequestHeaders.Generated.cs (7)
1163if (string.Equals(key, HeaderNames.ContentType, StringComparison.OrdinalIgnoreCase)) 1392if (string.Equals(key, HeaderNames.ContentType, StringComparison.OrdinalIgnoreCase)) 1640if (string.Equals(key, HeaderNames.ContentType, StringComparison.OrdinalIgnoreCase)) 2002if (string.Equals(key, HeaderNames.ContentType, StringComparison.Ordinal)) 2259yield return HeaderNames.ContentType; 2595yield return new KeyValuePair<string, StringValues>(HeaderNames.ContentType, ContentType); 2764HttpSysRequestHeader.ContentType => HeaderNames.ContentType,
Microsoft.AspNetCore.WebUtilities (1)
MultipartSection.cs (1)
21if (Headers != null && Headers.TryGetValue(HeaderNames.ContentType, out var values))