20 writes to ContentType
Aspire.Hosting (1)
Dcp\DcpKubernetesClient.cs (1)
131httpRequest.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/merge-patch+json");
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageContent.cs (1)
132Headers.ContentType = contentTypeHeaderValue;
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");
NuGet.Protocol (1)
Resources\PackageUpdateResource.cs (1)
659packageContent.Headers.ContentType = MediaTypeHeaderValue.Parse("application/octet-stream");
Pipelines.Library (1)
DistributedApplicationPipelineExtensions.cs (1)
154content.Headers.ContentType = new MediaTypeHeaderValue("application/zip");
System.Net.Http (4)
System\Net\Http\FormUrlEncodedContent.cs (1)
23Headers.ContentType = new MediaTypeHeaderValue("application/x-www-form-urlencoded");
System\Net\Http\MultipartContent.cs (1)
61Headers.ContentType = contentType;
System\Net\Http\StringContent.cs (2)
73Headers.ContentType = new MediaTypeHeaderValue(mediaType, encoding.WebName); 83Headers.ContentType = mediaType;
System.Net.Http.Json (1)
System\Net\Http\Json\JsonContent.cs (1)
35Headers.ContentType = mediaType;
System.ServiceModel.Http (1)
System\ServiceModel\Channels\MessageContent.cs (1)
138Headers.ContentType = contentTypeHeaderValue;
33 references to ContentType
aspire (1)
Commands\TelemetryCommandHelpers.cs (1)
96var mediaType = response.Content.Headers.ContentType?.MediaType;
Aspire.Dashboard.Tests (9)
Integration\OtlpHttpJsonTests.cs (6)
418Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 479Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 556Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 606Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 667Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType); 727Assert.Equal(OtlpHttpEndpointsBuilder.JsonContentType, responseMessage.Content.Headers.ContentType?.MediaType);
Integration\OtlpHttpServiceTests.cs (1)
275Assert.Equal("application/json", responseMessage.Content.Headers.ContentType?.MediaType);
Integration\TelemetryApiTests.cs (2)
422Assert.Equal("application/x-ndjson", response.Content.Headers.ContentType?.MediaType); 453Assert.Equal("application/x-ndjson", response.Content.Headers.ContentType?.MediaType);
dotnet-svcutil-lib (5)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (2)
132var mediaValueContentType = content.Headers.ContentType; 341throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(string.Format(SRServiceModel.FramingContentTypeMismatch, _httpRequestMessage.Content.Headers.ContentType.ToString(), _httpRequestMessage.RequestUri)));
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageContent.cs (3)
96var actionParams = (from p in Headers.ContentType.Parameters where p.Name == "action" select p).ToArray(); 113new ProtocolException(string.Format(SRServiceModel.HttpContentTypeFormatException, formatException.Message, Headers.ContentType.ToString()), formatException)); 120Headers.ContentType.Parameters.Add(new NameValueHeaderValue("action", action));
Microsoft.Extensions.AI.Integration.Tests (3)
VerbatimMultiPartHttpHandler.cs (3)
49Assert.NotNull(request.Content.Headers.ContentType); 50Assert.Equal("multipart/form-data", request.Content.Headers.ContentType.MediaType); 61string? boundary = request.Content.Headers.ContentType.Parameters
Microsoft.Extensions.DataIngestion.Tests (2)
Readers\DocumentReaderConformanceTests.cs (2)
85source, mediaType: response.Content.Headers.ContentType?.MediaType!); 183string extension = response.Content.Headers.ContentType?.MediaType switch
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;
Microsoft.NET.Build.Containers (3)
Registry\Registry.cs (3)
195return initialManifestResponse.Content.Headers.ContentType?.MediaType switch 200initialManifestResponse.Content.Headers.ContentType.MediaType, 243return initialManifestResponse.Content.Headers.ContentType?.MediaType switch
System.Net.Http (1)
System\Net\Http\HttpContent.cs (1)
131string? charset = headers.ContentType?.CharSet;
System.Net.Http.Json (1)
System\Net\Http\Json\JsonHelpers.cs (1)
34if (content.Headers.ContentType?.CharSet is string charset)
System.ServiceModel.Http (6)
System\ServiceModel\Channels\HttpChannelFactory.cs (1)
1025var contentType = httpRequestMessage.Content.Headers.ContentType;
System\ServiceModel\Channels\HttpResponseMessageHelper.cs (2)
135var mediaValueContentType = content.Headers.ContentType; 369throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(SR.Format(SR.FramingContentTypeMismatch, _httpRequestMessage.Content.Headers.ContentType.ToString(), _httpRequestMessage.RequestUri)));
System\ServiceModel\Channels\MessageContent.cs (3)
102var actionParams = (from p in Headers.ContentType.Parameters where p.Name == "action" select p).ToArray(); 119new ProtocolException(SR.Format(SR.HttpContentTypeFormatException, formatException.Message, Headers.ContentType.ToString()), formatException)); 126Headers.ContentType.Parameters.Add(new NameValueHeaderValue("action", action));