1 type derived from MediaTypeHeaderValue
System.Net.Http (1)
System\Net\Http\Headers\MediaTypeWithQualityHeaderValue.cs (1)
9public sealed class MediaTypeWithQualityHeaderValue : MediaTypeHeaderValue, ICloneable
16 instantiations of MediaTypeHeaderValue
Microsoft.Extensions.AI.Evaluation.Safety (1)
ContentSafetyService.cs (1)
444httpRequestMessage.Content?.Headers.ContentType = new MediaTypeHeaderValue("application/json");
Microsoft.Extensions.Http.Diagnostics.PerformanceTests (2)
NoRemoteCallHandler.cs (1)
44response.Content.Headers.ContentType = new("application/json");
NoRemoteCallNotSeekableHandler.cs (1)
47response.Content.Headers.ContentType = new("application/json");
Microsoft.Extensions.Http.Diagnostics.Tests (3)
Logging\HttpHeadersReaderTest.cs (2)
132requestContent.Headers.ContentType = new(MediaTypeNames.Application.Soap); 141responseContent.Headers.ContentType = new(MediaTypeNames.Text.Html);
Logging\Internal\NoRemoteCallHandler.cs (1)
38response.Content.Headers.ContentType = new("application/json");
Microsoft.NET.Build.Containers (1)
Registry\DefaultManifestOperations.cs (1)
44manifestUploadContent.Headers.ContentType = new MediaTypeHeaderValue(mediaType);
Microsoft.NET.Sdk.Publish.Tasks (2)
Tasks\Http\HttpClientExtensions.cs (2)
59ContentType = new MediaTypeHeaderValue(contentType) 116ContentType = new MediaTypeHeaderValue(contentType),
NuGet.Packaging (1)
Signing\Timestamp\Rfc3161TimestampRequestNetstandard21Wrapper.cs (1)
58content.Headers.ContentType = new MediaTypeHeaderValue("application/timestamp-query");
Pipelines.Library (1)
DistributedApplicationPipelineExtensions.cs (1)
154content.Headers.ContentType = new MediaTypeHeaderValue("application/zip");
System.Net.Http (5)
System\Net\Http\FormUrlEncodedContent.cs (1)
23Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
System\Net\Http\Headers\MediaTypeHeaderParser.cs (1)
32private static MediaTypeHeaderValue CreateMediaType() => new MediaTypeHeaderValue();
System\Net\Http\Headers\MediaTypeHeaderValue.cs (1)
291return new MediaTypeHeaderValue(this);
System\Net\Http\MultipartContent.cs (1)
59MediaTypeHeaderValue contentType = new MediaTypeHeaderValue("multipart/" + subtype);
System\Net\Http\StringContent.cs (1)
73Headers.ContentType = new MediaTypeHeaderValue(mediaType, encoding.WebName);
61 references to MediaTypeHeaderValue
Aspire.Dashboard (2)
Otlp\Http\OtlpHttpEndpointsBuilder.cs (2)
86if (contentType != null && MediaTypeHeaderValue.TryParse(contentType, out var mt))
Aspire.Hosting (1)
Dcp\DcpKubernetesClient.cs (1)
131httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/merge-patch+json");
dotnet-svcutil-lib (7)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (1)
132var mediaValueContentType = content.Headers.ContentType;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageContent.cs (2)
129MediaTypeHeaderValue contentTypeHeaderValue; 130if (MediaTypeHeaderValue.TryParse(contentType, out contentTypeHeaderValue))
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageEncoder.cs (2)
201MediaTypeHeaderValue parsedContentType = MediaTypeHeaderValue.Parse(contentType);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\TextMessageEncoder.cs (2)
215MediaTypeHeaderValue parsedContentType = MediaTypeHeaderValue.Parse(contentType);
Microsoft.Extensions.AI.Abstractions (1)
Contents\DataUriParser.cs (1)
138return MediaTypeHeaderValue.TryParse(mediaType, out _);
Microsoft.Extensions.Http.Diagnostics (2)
Logging\Internal\HttpRequestBodyReader.cs (1)
44var contentType = request.Content.Headers.ContentType;
Logging\Internal\HttpResponseBodyReader.cs (1)
49MediaTypeHeaderValue? contentType = response.Content.Headers.ContentType;
netstandard (1)
netstandard.cs (1)
1108[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Http.Headers.MediaTypeHeaderValue))]
NuGet.Protocol (1)
Resources\PackageUpdateResource.cs (1)
659packageContent.Headers.ContentType = MediaTypeHeaderValue.Parse("application/octet-stream");
System.Net.Http (33)
System\Net\Http\Headers\HttpContentHeaders.cs (2)
91public MediaTypeHeaderValue? ContentType 93get { return (MediaTypeHeaderValue?)GetSingleParsedValue(KnownHeaders.ContentType.Descriptor); }
System\Net\Http\Headers\MediaTypeHeaderParser.cs (5)
10private readonly Func<MediaTypeHeaderValue> _mediaTypeCreator; 16private MediaTypeHeaderParser(bool supportsMultipleValues, Func<MediaTypeHeaderValue> mediaTypeCreator) 26int resultLength = MediaTypeHeaderValue.GetMediaTypeLength(value, startIndex, _mediaTypeCreator, out MediaTypeHeaderValue? temp); 32private static MediaTypeHeaderValue CreateMediaType() => new MediaTypeHeaderValue();
System\Net\Http\Headers\MediaTypeHeaderValue.cs (23)
14/// The <see cref="MediaTypeHeaderValue"/> class provides support for the media type used in a Content-Type header 81/// <summary>Initializes a new instance of the <see cref="MediaTypeHeaderValue"/> class.</summary> 82/// <param name="source">A <see cref="MediaTypeHeaderValue"/> object used to initialize the new instance.</param> 83protected MediaTypeHeaderValue(MediaTypeHeaderValue source) 91/// <summary>Initializes a new instance of the <see cref="MediaTypeHeaderValue"/> class.</summary> 98/// <summary>Initializes a new instance of the <see cref="MediaTypeHeaderValue"/> class.</summary> 112/// <summary>Returns a string that represents the current <see cref="MediaTypeHeaderValue"/> object.</summary> 127/// <summary>Determines whether the specified <see cref="object"/> is equal to the current <see cref="MediaTypeHeaderValue"/> object.</summary> 131obj is MediaTypeHeaderValue other && 135/// <summary>Serves as a hash function for an <see cref="MediaTypeHeaderValue"/> object.</summary> 147/// <summary>Converts a string to an <see cref="MediaTypeHeaderValue"/> instance.</summary> 149/// <returns>A <see cref="MediaTypeHeaderValue"/> instance.</returns> 152public static MediaTypeHeaderValue Parse(string input) 155return (MediaTypeHeaderValue)MediaTypeHeaderParser.SingleValueParser.ParseValue(input, null, ref index); 158/// <summary>Determines whether a string is valid <see cref="MediaTypeHeaderValue"/> information.</summary> 160/// <param name="parsedValue">The <see cref="MediaTypeHeaderValue"/> version of the string.</param> 161/// <returns><see langword="true"/> if input is valid <see cref="MediaTypeHeaderValue"/> information; otherwise, <see langword="false"/>.</returns> 162public static bool TryParse([NotNullWhen(true)] string? input, [NotNullWhen(true)] out MediaTypeHeaderValue? parsedValue) 169parsedValue = (MediaTypeHeaderValue)output!; 176Func<MediaTypeHeaderValue> mediaTypeCreator, out MediaTypeHeaderValue? parsedValue) 189int mediaTypeLength = MediaTypeHeaderValue.GetMediaTypeExpressionLength(input, startIndex, out string? mediaType); 198MediaTypeHeaderValue mediaTypeHeader;
System\Net\Http\MultipartContent.cs (1)
59MediaTypeHeaderValue contentType = new MediaTypeHeaderValue("multipart/" + subtype);
System\Net\Http\StringContent.cs (2)
30public StringContent(string content, MediaTypeHeaderValue? mediaType) 80public StringContent(string content, Encoding? encoding, MediaTypeHeaderValue? mediaType)
System.Net.Http.Json (5)
System\Net\Http\Json\JsonContent.cs (5)
25MediaTypeHeaderValue? mediaType) 53public static JsonContent Create<T>(T inputValue, MediaTypeHeaderValue? mediaType = null, JsonSerializerOptions? options = null) 66public static JsonContent Create(object? inputValue, Type inputType, MediaTypeHeaderValue? mediaType = null, JsonSerializerOptions? options = null) 82public static JsonContent Create<T>(T? inputValue, JsonTypeInfo<T> jsonTypeInfo, MediaTypeHeaderValue? mediaType = null) 96public static JsonContent Create(object? inputValue, JsonTypeInfo jsonTypeInfo, MediaTypeHeaderValue? mediaType = null)
System.ServiceModel.Http (4)
System\ServiceModel\Channels\HttpChannelFactory.cs (1)
1025var contentType = httpRequestMessage.Content.Headers.ContentType;
System\ServiceModel\Channels\HttpResponseMessageHelper.cs (1)
135var mediaValueContentType = content.Headers.ContentType;
System\ServiceModel\Channels\MessageContent.cs (2)
135MediaTypeHeaderValue contentTypeHeaderValue; 136if (MediaTypeHeaderValue.TryParse(contentType, out contentTypeHeaderValue))
System.ServiceModel.Primitives (4)
System\ServiceModel\Channels\MessageEncoder.cs (2)
214MediaTypeHeaderValue parsedContentType = MediaTypeHeaderValue.Parse(contentType);
System\ServiceModel\Channels\TextMessageEncoder.cs (2)
216MediaTypeHeaderValue parsedContentType = MediaTypeHeaderValue.Parse(contentType);