41 instantiations of new
Diagnostics.FunctionalTests (5)
DeveloperExceptionPageSampleTest.cs (1)
42request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
ProblemDetailsExceptionHandlerSampleTest.cs (2)
27request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); 44request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
StatusCodeSampleTest.cs (2)
61request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/plain")); 82request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
219requestMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (2)
Logging\AcceptanceTests.cs (2)
297request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(MediaTypeNames.Application.Json)); 357httpMessage.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(MediaTypeNames.Application.Json));
Microsoft.AspNetCore.Diagnostics.Tests (6)
DeveloperExceptionPageMiddlewareTest.cs (5)
63request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); 116request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); 175request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); 254client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html")); 329client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html"));
ExceptionHandlerMiddlewareTest.cs (1)
69request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
Microsoft.AspNetCore.Http.Connections.Client (5)
HttpConnection.cs (1)
479request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("*/*"));
Internal\LongPollingTransport.cs (2)
55request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("*/*")); 155request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("*/*"));
Internal\SendUtils.cs (1)
44request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("*/*"));
Internal\ServerSentEventsTransport.cs (1)
56request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("text/event-stream"));
Microsoft.AspNetCore.Mvc.FunctionalTests (9)
ContentNegotiationTest.cs (3)
129request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); 154request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml")); 347request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml"));
ErrorPageTests.cs (2)
36Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html")); 56client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html"));
SerializableErrorTests.cs (2)
51request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptHeader)); 76request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(acceptHeader));
XmlDataContractSerializerInputFormatterTest.cs (2)
60request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml-dcs")); 88request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/xml-dcs"));
Microsoft.AspNetCore.SignalR.Client.Tests (6)
HttpConnectionTests.cs (1)
174var headerFound = request.Headers.Accept?.Contains(new MediaTypeWithQualityHeaderValue("*/*")) == true;
LongPollingTransportTests.cs (1)
709if (request.Headers.Accept?.Contains(new MediaTypeWithQualityHeaderValue("*/*")) != true)
SendUtilsTests.cs (1)
24if (request.Headers.Accept?.Contains(new MediaTypeWithQualityHeaderValue("*/*")) == true)
ServerSentEventsTransportTests.cs (3)
180if (request.Headers.Accept?.Contains(new MediaTypeWithQualityHeaderValue("text/event-stream")) == true) 309if (request.Headers.Accept?.Contains(new MediaTypeWithQualityHeaderValue("text/event-stream")) == true) 417if (request.Headers.Accept?.Contains(new MediaTypeWithQualityHeaderValue("text/event-stream")) == true)
Microsoft.AspNetCore.SpaProxy (1)
SpaProxyLaunchManager.cs (1)
102httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("*/*", 0.1));
Microsoft.DotNet.Internal.SymbolHelper (2)
SymbolPromotionHelper.cs (1)
205Accept = { new("application/json") }
SymbolUploadHelperFactory.cs (1)
150using HttpRequestMessage getToolRequest = new(HttpMethod.Get, downloadUri) { Headers = { Accept = { new ("application/zip") } } };
SocialSample (2)
Startup.cs (2)
139request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); 200request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
System.Net.Http (2)
System\Net\Http\Headers\MediaTypeHeaderParser.cs (1)
34private static MediaTypeWithQualityHeaderValue CreateMediaTypeWithQuality() => new MediaTypeWithQualityHeaderValue();
System\Net\Http\Headers\MediaTypeWithQualityHeaderValue.cs (1)
42return new MediaTypeWithQualityHeaderValue(this);
42 references to new
Microsoft.AspNetCore.Mvc.FunctionalTests (33)
ContentNegotiationTest.cs (4)
386request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json")); 405request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/custom1")); 421request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/custom1")); 436request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
JsonOutputFormatterTestBase.cs (1)
52request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json"));
SerializableErrorTests.cs (2)
121request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse(acceptHeader)); 162request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse(acceptHeader));
XmlDataContractSerializerFormattersWrappingTest.cs (8)
45request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs")); 69request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs")); 93request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs")); 116request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs")); 139request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs")); 164request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs")); 187request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs")); 208request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-dcs"));
XmlOutputFormatterTests.cs (10)
43request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml")); 65request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml")); 88request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml")); 109request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml")); 132request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml")); 153request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml")); 171request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml")); 191request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml")); 211request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml")); 232request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml"));
XmlSerializerFormattersWrappingTest.cs (8)
44request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-xmlser")); 65request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-xmlser")); 86request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-xmlser")); 106request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-xmlser")); 126request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-xmlser")); 148request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-xmlser")); 168request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-xmlser")); 186request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/xml-xmlser"));
netstandard (1)
netstandard.cs (1)
1109[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue))]
System.Net.Http (8)
System\Net\Http\Headers\HttpRequestHeaders.cs (2)
37public HttpHeaderValueCollection<MediaTypeWithQualityHeaderValue> Accept => 38GetSpecializedCollection(AcceptSlot, static thisRef => new HttpHeaderValueCollection<MediaTypeWithQualityHeaderValue>(KnownHeaders.Accept.Descriptor, thisRef));
System\Net\Http\Headers\MediaTypeHeaderParser.cs (1)
34private static MediaTypeWithQualityHeaderValue CreateMediaTypeWithQuality() => new MediaTypeWithQualityHeaderValue();
System\Net\Http\Headers\MediaTypeWithQualityHeaderValue.cs (5)
34private MediaTypeWithQualityHeaderValue(MediaTypeWithQualityHeaderValue source) 45public static new MediaTypeWithQualityHeaderValue Parse(string input) 48return (MediaTypeWithQualityHeaderValue)MediaTypeHeaderParser.SingleValueWithQualityParser.ParseValue( 52public static bool TryParse([NotNullWhen(true)] string? input, [NotNullWhen(true)] out MediaTypeWithQualityHeaderValue? parsedValue) 59parsedValue = (MediaTypeWithQualityHeaderValue)output!;