64 references to MediaType
Aspire.Dashboard (2)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (2)
80if (string.Equals(mt.MediaType, JsonContentType, StringComparison.OrdinalIgnoreCase)) 86if (string.Equals(mt.MediaType, ProtobufContentType, StringComparison.OrdinalIgnoreCase))
AuthSamples.FunctionalTests (1)
TestAssert.cs (1)
76Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType);
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncoder.cs (1)
203if (supportedMediaType.Length > 0 && !supportedMediaType.Equals(parsedContentType.MediaType, StringComparison.OrdinalIgnoreCase))
Microsoft.AspNetCore.Authentication.OpenIdConnect (5)
OpenIdConnectHandler.cs (5)
612if (!(contentType?.MediaType?.Equals("application/json", StringComparison.OrdinalIgnoreCase) ?? false)) 996var contentMediaType = responseMessage.Content.Headers.ContentType?.MediaType; 1066if (contentType?.MediaType?.Equals("application/json", StringComparison.OrdinalIgnoreCase) ?? false) 1070else if (contentType?.MediaType?.Equals("application/jwt", StringComparison.OrdinalIgnoreCase) ?? false) 1077return HandleRequestResult.Fail("Unknown response type: " + contentType?.MediaType, properties);
Microsoft.AspNetCore.Authentication.Test (13)
CertificateTests.cs (7)
471response.Content.Headers.ContentType.MediaType == "text/xml") 602response.Content.Headers.ContentType.MediaType == "text/xml") 621response.Content.Headers.ContentType.MediaType == "text/xml") 672response.Content.Headers.ContentType.MediaType == "text/xml") 729response.Content.Headers.ContentType.MediaType == "text/xml") 748response.Content.Headers.ContentType.MediaType == "text/xml") 770response.Content.Headers.ContentType.MediaType == "text/xml")
CookieTests.cs (1)
1927transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
JwtBearerTests.cs (1)
1266transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
JwtBearerTests_Handler.cs (1)
1333transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
OpenIdConnect\OpenIdConnectChallengeTests.cs (1)
165Assert.Equal("text/html", transaction.Response.Content.Headers.ContentType.MediaType);
OpenIdConnect\TestServerExtensions.cs (1)
43transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
TestExtensions.cs (1)
38transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterHandler.cs (1)
358var contentTypeIsJson = string.Equals(response.Content.Headers.ContentType?.MediaType ?? "", "application/json", StringComparison.OrdinalIgnoreCase);
Microsoft.AspNetCore.CookiePolicy.Test (1)
TestExtensions.cs (1)
35transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
Microsoft.AspNetCore.Diagnostics.Tests (2)
DeveloperExceptionPageMiddlewareTest.cs (2)
261Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 296Assert.Equal("text/plain", response.Content.Headers.ContentType.MediaType);
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Extensions\ResponseAssert.cs (1)
24Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType);
Microsoft.AspNetCore.Identity.InMemory.Test (1)
FunctionalTest.cs (1)
456transaction.Response.Content.Headers.ContentType.MediaType == "text/xml")
Microsoft.AspNetCore.Mvc.FunctionalTests (26)
ApiBehaviorTest.cs (2)
62Assert.Equal("application/problem+json", response.Content.Headers.ContentType.MediaType); 451Assert.Equal("application/vnd.error+json", response.Content.Headers.ContentType.MediaType);
BasicTests.cs (3)
246Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 269Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 292Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType);
CustomValueProviderTest.cs (4)
51Assert.Equal("text/plain", response.Content.Headers.ContentType.MediaType); 68Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 85Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 102Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType);
JsonResultWithNewtonsoftJsonTest.cs (5)
51Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 73Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 91Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 109Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 142Assert.Equal("application/message+json", response.Content.Headers.ContentType.MediaType);
JsonResultWithSystemTextJsonTest.cs (5)
51Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 73Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 91Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 109Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 142Assert.Equal("application/message+json", response.Content.Headers.ContentType.MediaType);
RazorPagesTest.cs (2)
899Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 915Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType);
RemoteAttributeValidationTest.cs (3)
49Assert.Equal("text/html", response.Content.Headers.ContentType.MediaType); 74Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType); 103Assert.Equal("application/json", response.Content.Headers.ContentType.MediaType);
SerializableErrorTests.cs (2)
61Assert.Equal(acceptHeader, response.Content.Headers.ContentType.MediaType); 85Assert.Equal(acceptHeader, response.Content.Headers.ContentType.MediaType);
Microsoft.AspNetCore.Routing.FunctionalTests (5)
Benchmarks\EndpointRoutingBenchmarkTest.cs (1)
52Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType);
Benchmarks\RouterBenchmarkTest.cs (1)
53Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType);
EndpointRoutingSampleTest.cs (3)
59Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType); 76Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType); 95Assert.Equal(expectedContentType, response.Content.Headers.ContentType.MediaType);
Microsoft.AspNetCore.SignalR.Client.Tests (1)
ResponseUtils.cs (1)
55return request.Method == HttpMethod.Get && request.Headers.Accept.Any(h => h.MediaType == "text/event-stream");
Microsoft.AspNetCore.Tests (2)
WebApplicationTests.cs (2)
2042Assert.Contains("text/plain", response.Content.Headers.ContentType.MediaType); 2147Assert.Contains("text/plain", response.Content.Headers.ContentType.MediaType);
Microsoft.Extensions.Http.Diagnostics (2)
Logging\Internal\HttpRequestBodyReader.cs (1)
60if (!_readableRequestContentTypes.Covers(contentType.MediaType))
Logging\Internal\HttpResponseBodyReader.cs (1)
52if (!_readableResponseContentTypes.Covers(contentType.MediaType!))