207 writes to Content
Aspire.Dashboard.Tests (3)
Integration\OtlpHttpServiceTests.cs (3)
141requestMessage.Content = content; 169requestMessage.Content = content; 261requestMessage.Content = content;
Aspire.Hosting.Redis (1)
RedisBuilderExtensions.cs (1)
284Content = deleteContent
AuthSamples.FunctionalTests (1)
HttpClientExtensions.cs (1)
49Content = new StreamContent(submit.Body)
Binding.Http.IntegrationTests (1)
BasicHttpBindingTests.4.0.0.cs (1)
165message.Content = new StringContent(requestMessageBody);
dotnet-svcutil-lib (4)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpChannelFactory.cs (1)
918_httpRequestMessage.Content = MessageContent.Create(_factory, request, _timeoutHelper);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageExtensionMethods.cs (1)
74httpRequestMessage.Content = new ByteArrayContent(Array.Empty<byte>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageProperty.cs (2)
349this.HttpRequestMessage.Content = newContent; 354this.HttpRequestMessage.Content = new ByteArrayContent(Array.Empty<byte>());
HttpStress (7)
Program.cs (7)
243using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri) { Version = httpVersion, Content = new StringDuplexContent(content) }) 257using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri + "/duplex") { Version = httpVersion, Content = new StringDuplexContent(content) }) 271using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri + "/duplexSlow") { Version = httpVersion, Content = new ByteAtATimeNoLengthContent(Encoding.ASCII.GetBytes(content)) }) 285using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri) { Version = httpVersion, Content = new StringContent(content) }) 302using (var req = new HttpRequestMessage(HttpMethod.Post, serverUri) { Version = httpVersion, Content = new StringContent(content) }) 305req.Content = new CancelableContent(cts.Token); 347using (var req = new HttpRequestMessage(HttpMethod.Put, serverUri) { Version = httpVersion, Content = new StringContent(content) })
Interop.FunctionalTests (12)
Http3\Http3RequestTests.cs (11)
294request.Content = requestContent; 375request.Content = requestContent; 418request.Content = requestContent; 489request.Content = requestContent; 560request.Content = requestContent; 725request.Content = requestContent; 1014request.Content = requestContent; 1111request.Content = requestContent; 1370request.Content = new ByteArrayContent(TestData); 2039request.Content = requestContent; 2139request.Content = requestContent;
HttpClientHttp2InteropTests.cs (1)
1702Content = content,
Microsoft.AspNetCore.Authentication.OAuth (1)
OAuthHandler.cs (1)
220requestMessage.Content = requestContent;
Microsoft.AspNetCore.Authentication.OpenIdConnect (2)
OpenIdConnectHandler.cs (2)
597requestMessage.Content = new FormUrlEncodedContent(parRequest.Parameters); 992requestMessage.Content = new FormUrlEncodedContent(tokenEndpointRequest.Parameters);
Microsoft.AspNetCore.Authentication.Test (5)
OpenIdConnect\OpenIdConnectAuthenticateTests.cs (1)
59request.Content = new FormUrlEncodedContent(new Dictionary<string, string>());
WsFederation\WsFederationTest.cs (2)
128request.Content = CreateSignInContent("WsFederation/ValidToken.xml", queryItems["wctx"]); 179request.Content = CreateSignInContent("WsFederation/InvalidToken.xml", queryItems["wctx"]);
WsFederation\WsFederationTest_Handler.cs (2)
126request.Content = CreateSignInContent("WsFederation/ValidToken.xml", queryItems["wctx"]); 177request.Content = CreateSignInContent("WsFederation/InvalidToken.xml", queryItems["wctx"]);
Microsoft.AspNetCore.Authentication.Twitter (1)
TwitterHandler.cs (1)
263request.Content = new FormUrlEncodedContent(formData!);
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (1)
Logging\AcceptanceTests.cs (1)
294Content = new StringContent(Content)
Microsoft.AspNetCore.HeaderPropagation.Tests (3)
HeaderPropagationMessageHandlerTest.cs (3)
75await Client.SendAsync(new HttpRequestMessage() { Content = new StringContent("test") }); 89await Client.SendAsync(new HttpRequestMessage() { Content = new StringContent("test") }); 103await Client.SendAsync(new HttpRequestMessage() { Content = new StringContent("test") });
Microsoft.AspNetCore.Http.Connections.Client (1)
Internal\SendUtils.cs (1)
45request.Content = new ReadOnlySequenceContent(buffer);
Microsoft.AspNetCore.HttpLogging.Tests (2)
HttpLoggingMiddlewareTests.cs (2)
1776var request = new HttpRequestMessage(HttpMethod.Get, "/attr_restrictedsize") { Content = new ReadOnlyMemoryContent("from request"u8.ToArray()) }; 1866var request = new HttpRequestMessage(HttpMethod.Get, "/ext_restrictedsize") { Content = new ReadOnlyMemoryContent("from request"u8.ToArray()) };
Microsoft.AspNetCore.HttpOverrides.Tests (3)
HttpMethodOverrideMiddlewareTest.cs (3)
134req.Content = new FormUrlEncodedContent(new Dictionary<string, string>() 172req.Content = new FormUrlEncodedContent(new Dictionary<string, string>() 209req.Content = new FormUrlEncodedContent(new Dictionary<string, string>()
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Extensions\HttpClientExtensions.cs (1)
51Content = new StreamContent(submit.Body)
Microsoft.AspNetCore.Mvc.FunctionalTests (69)
AntiforgeryMiddlewareTest.cs (5)
49request.Content = new FormUrlEncodedContent(nameValueCollection); 90request.Content = new FormUrlEncodedContent(nameValueCollection); 133request.Content = new FormUrlEncodedContent(nameValueCollection); 165request.Content = new FormUrlEncodedContent(nameValueCollection); 197request.Content = new FormUrlEncodedContent(nameValueCollection);
AntiforgeryTests.cs (3)
76request.Content = new FormUrlEncodedContent(nameValueCollection); 126request.Content = new FormUrlEncodedContent(nameValueCollection); 155request.Content = new FormUrlEncodedContent(nameValueCollection);
ApiBehaviorTest.cs (2)
105Content = new StringContent("some content", Encoding.UTF8, "text/css"), 121Content = new StringContent("some content", Encoding.Latin1, "application/json"),
BasicTests.cs (1)
650request.Content = new MultipartFormDataContent();
ConsumesAttributeTestsBase.cs (5)
102request.Content = new StringContent(input, Encoding.UTF8, requestContentType); 123request.Content = new StringContent(input, Encoding.UTF8, requestContentType); 147request.Content = new StringContent(input, Encoding.UTF8, "application/xml"); 168request.Content = new StringContent(input, Encoding.UTF8, "application/vnd.example+json"); 191request.Content = new StringContent(input, Encoding.UTF8, "application/vnd.example+xml");
ContentNegotiationTest.cs (1)
406request.Content = content;
DoNotRespectBrowserAcceptHeaderTests.cs (2)
100request.Content = new StringContent(requestData, Encoding.UTF8, "application/xml"); 131request.Content = new StringContent(requestData, Encoding.UTF8, "application/xml");
FiltersTest.cs (1)
89Content = new StringContent("Test", Encoding.UTF8, "application/json"),
FormFileUploadTest.cs (2)
40request.Content = content; 68request.Content = content;
HtmlGenerationTest.cs (4)
333request.Content = new FormUrlEncodedContent(nameValueCollection); 386request.Content = new FormUrlEncodedContent(nameValueCollection); 618requestMessage.Content = new StringContent(content, Encoding.UTF8, "application/json"); 787request.Content = new FormUrlEncodedContent(new Dictionary<string, string>
InputObjectValidationTests.cs (4)
270Content = new StringContent(@"{ ""Id"": ""S-1-5-21-1004336348-1177238915-682003330-512"" }", Encoding.UTF8, "application/json"), 291Content = new StringContent(input, Encoding.UTF8, "application/json"), 320Content = new StringContent(input, Encoding.UTF8, "application/json"), 352Content = new StringContent(input, Encoding.UTF8, "application/xml"),
JsonInputFormatterTestBase.cs (1)
225request.Content = content;
JsonOutputFormatterTestBase.cs (1)
53request.Content = new StringContent(input, Encoding.UTF8, "application/xml");
JsonPatchInputFormatterTest.cs (1)
167Content = new StringContent(body, Encoding.UTF8, "application/json-patch+json"),
NonNullableReferenceTypesTest.cs (2)
54request.Content = new FormUrlEncodedContent(new[] 96request.Content = new FormUrlEncodedContent(new[]
RazorPageModelTest.cs (6)
41Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 66Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 91Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 117Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 142Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 167Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[]
RazorPagesTest.cs (11)
673Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 702Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 728Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 759Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 788Content = new FormUrlEncodedContent(new Dictionary<string, string> 813Content = new FormUrlEncodedContent(new Dictionary<string, string> 844Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 869Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 985Content = new FormUrlEncodedContent(new KeyValuePair<string, string>[] 1290Content = new FormUrlEncodedContent(new Dictionary<string, string> 1328Content = new FormUrlEncodedContent(new[]
RazorPagesWithBasePathTest.cs (4)
434Content = new FormUrlEncodedContent(new Dictionary<string, string> 463Content = new FormUrlEncodedContent(new Dictionary<string, string> 491Content = new FormUrlEncodedContent(new Dictionary<string, string> 709Content = content,
ReadFromDisconnectedClientTest.cs (1)
56request.Content = new FormUrlEncodedContent(new Dictionary<string, string>
RequestSizeLimitTest.cs (1)
83request.Content = new StringContent(expected, Encoding.UTF8, "text/json");
RoutingFallbackTest.cs (1)
138Content = new StringContent("some plaintext", Encoding.UTF8, "text/plain"),
SerializableErrorTests.cs (3)
74Content = new StringContent(expectedXml, Encoding.UTF8, acceptHeader) 122request.Content = new StringContent(inputXml, Encoding.UTF8, acceptHeader); 163request.Content = new StringContent(inputXml, Encoding.UTF8, acceptHeader);
SimpleWithWebApplicationBuilderTests.cs (2)
233request.Content = new StringContent("<xml />"); 248request.Content = new StringContent("<xml />");
TempDataInCookiesUsingCookieConsentTest.cs (1)
102request.Content = content;
TestingInfrastructureTests.cs (2)
58Content = new ObjectContent<Number>(new Number { Value = 5 }, new JsonMediaTypeFormatter()) 79Content = new ObjectContent<Number>(new Number { Value = 5 }, new JsonMediaTypeFormatter())
XmlDataContractSerializerInputFormatterTest.cs (2)
59request.Content = new StringContent(input, Encoding.UTF8, "application/xml-dcs"); 87request.Content = new StringContent(input, Encoding.UTF8, "application/xml-dcs");
Microsoft.AspNetCore.Mvc.Testing (2)
Handlers\RedirectHandler.cs (2)
76request.Content = new StreamContent(originalBody); 157redirect.Content = originalContent;
Microsoft.AspNetCore.RequestDecompression.Tests (6)
RequestDecompressionMiddlewareTests.cs (6)
240request.Content = new ByteArrayContent(compressedBytes); 311request.Content = new ByteArrayContent(compressedBytes); 387request.Content = new ByteArrayContent(compressedBytes); 489request.Content = new ByteArrayContent(compressedBytes); 573request.Content = new ByteArrayContent(compressedBytes); 724request.Content = new ByteArrayContent(compressedContent);
Microsoft.AspNetCore.Routing.FunctionalTests (16)
MinimalFormTests.cs (13)
62request.Content = new FormUrlEncodedContent(nameValueCollection); 122request.Content = new FormUrlEncodedContent(nameValueCollection); 167request.Content = new FormUrlEncodedContent(nameValueCollection); 206request.Content = new FormUrlEncodedContent(nameValueCollection); 283request.Content = new FormUrlEncodedContent(nameValueCollection); 330request.Content = new FormUrlEncodedContent(nameValueCollection); 426request.Content = new FormUrlEncodedContent(nameValueCollection); 483request.Content = new FormUrlEncodedContent(nameValueCollection); 545request.Content = new FormUrlEncodedContent(nameValueCollection); 597request.Content = new FormUrlEncodedContent(nameValueCollection); 649request.Content = new FormUrlEncodedContent(nameValueCollection); 695request.Content = new FormUrlEncodedContent(nameValueCollection); 752Content = new ByteArrayContent([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]),
WebHostBuilderExtensionsTest.cs (3)
37new HttpRequestMessage(HttpMethod.Post, "greeting/James") { Content = new StringContent("Biography") }, 49new HttpRequestMessage(HttpMethod.Put, "greeting/James") { Content = new StringContent("Biography") }, 67new HttpRequestMessage(HttpMethod.Post, "greeting/James") { Content = new StringContent("Biography") },
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (1)
OpaqueUpgradeTests.cs (1)
299request.Content = new StringContent("Hello World");
Microsoft.AspNetCore.SpaServices.Extensions (1)
Proxying\SpaProxy.cs (1)
141requestMessage.Content = streamContent;
Microsoft.AspNetCore.TestHost (1)
RequestBuilder.cs (1)
56_req.Content = new StreamContent(Stream.Null);
Microsoft.AspNetCore.TestHost.Tests (9)
ClientHandlerTests.cs (2)
361message.Content = new StringContent("Hello World"); 499message.Content = new StringContent("Hello World");
TestClientTests.cs (7)
198httpRequest.Content = new PushContent(async stream => 254message.Content = new PushContent(stream => throw new InvalidOperationException("HttpContent exception")); 306httpRequest.Content = new PushContent(async stream => 363httpRequest.Content = new PushContent(async stream => 425httpRequest.Content = new PushContent(async stream => 472httpRequest.Content = new PushContent(async stream => 523httpRequest.Content = new PushContent(async stream =>
Microsoft.DotNet.Build.Tasks.Feed (1)
src\CreateAzureDevOpsFeed.cs (1)
149createFeedMessage.Content = new StringContent(createBody, Encoding.UTF8, "application/json");
Microsoft.DotNet.Deployment.Tasks.Links (1)
Microsoft.DotNet.Helix.Sdk (3)
CreateFailedTestsForFailedWorkItems.cs (1)
43Content = new StringContent(
StartAzurePipelinesTestRun.cs (1)
38Content = new StringContent(
StopAzurePipelinesTestRun.cs (1)
33Content = new StringContent(
Microsoft.DotNet.Internal.SymbolHelper (2)
SymbolPromotionHelper.cs (2)
152Content = new StringContent(payload.ToString(), Encoding.UTF8, "application/json") 269Content = new StringContent(extensionPayload.ToString(), Encoding.UTF8, "application/json")
Microsoft.DotNet.VersionTools (4)
Automation\GitHubApi\GitHubClient.cs (3)
210request.Content = new StringContent(JsonConvert.SerializeObject(updatePrBody)); 374Content = bodyContent 398Content = bodyContent
Automation\VstsApi\VstsAdapterClient.cs (1)
171Content = new StringContent(
Microsoft.Extensions.Http.Diagnostics.Tests (31)
Logging\HttpClientLoggerTest.cs (13)
87Content = new StringContent(input, Encoding.UTF8, TextPlain) 125Content = new StringContent(input, Encoding.UTF8, TextPlain) 187Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 283Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 388Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 484Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 599Content = new StringContent(requestContent, Encoding.UTF8, TextPlain) 691Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 734Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 772Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 816Content = new StringContent(_fixture.Create<string>(), Encoding.UTF8, TextPlain) 866Content = requestContent, 961Content = new StringContent("request_content", Encoding.UTF8, TextPlain)
Logging\HttpHeadersReaderTest.cs (1)
136using var httpRequest = new HttpRequestMessage { Content = requestContent };
Logging\HttpRequestBodyReaderTest.cs (9)
41Content = new StringContent(input, Encoding.UTF8, "text/plain"), 61Content = new StreamContent(new MemoryStream()), 85Content = new StringContent(input, Encoding.UTF8, contentType), 106Content = new StringContent(input, Encoding.UTF8, "text/plain"), 134Content = new StringContent(input, Encoding.UTF8, "text/plain"), 158Content = new StringContent(input, Encoding.UTF8, "text/plain"), 185Content = new StreamContent(streamMock.Object), 211Content = null, 232Content = new StringContent("content", Encoding.UTF8, "text/plain"),
Logging\HttpRequestReaderTest.cs (8)
84Content = new StringContent(requestContent, Encoding.UTF8) 147Content = new StringContent(requestContent, Encoding.UTF8) 210Content = new StringContent(requestContent, Encoding.UTF8), 285Content = new StringContent(requestContent, Encoding.UTF8), 357Content = new StringContent(requestContent, Encoding.UTF8), 415Content = new StringContent(requestContent, Encoding.UTF8), 486Content = new StringContent(requestContent, Encoding.UTF8), 553Content = new StringContent(requestContent, Encoding.UTF8),
Microsoft.Extensions.Http.Resilience (1)
Internal\RequestMessageSnapshot.cs (1)
36Content = _content,
Microsoft.Extensions.Http.Resilience.Tests (2)
Resilience\RequestMessageSnapshotTests.cs (2)
25Content = new StreamContent(new MemoryStream()) 60Content = new StringContent("{\"name\":\"John Doe\",\"age\":33}", Encoding.UTF8, "application/json")
Microsoft.Extensions.Logging.AzureAppServices (2)
BlobAppendReferenceWrapper.cs (2)
37Content = new ByteArrayContent(data.Array, data.Offset, data.Count) 52Content = new ByteArrayContent(Array.Empty<byte>()),
System.Net.Http (4)
System\Net\Http\HttpClient.cs (3)
399request.Content = content; 415request.Content = content; 431request.Content = content;
System\Net\Http\SocketsHttpHandler\RedirectHandler.cs (1)
75request.Content = null;
System.Net.Requests (2)
System\Net\HttpWebRequest.cs (2)
1181_sendRequestMessage.Content = content; 1200_sendRequestMessage.Content ??= new ByteArrayContent(Array.Empty<byte>());
99 references to Content
AuthSamples.FunctionalTests (1)
HttpClientExtensions.cs (1)
56submision.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
Binding.Http.IntegrationTests (4)
BasicHttpBindingTests.4.0.0.cs (4)
162var oldContent = message.Content; 168if (!header.Key.Equals("Content-Length") && message.Content.Headers.Contains(header.Key)) 170message.Content.Headers.Remove(header.Key); 173message.Content.Headers.Add(header.Key, header.Value);
dotnet-svcutil-lib (7)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageExtensionMethods.cs (4)
72if (httpRequestMessage.Content == null) 84MergeWebHeaderCollectionWithHttpHeaders(headersToMerge, requestMessage.Headers, requestMessage.Content.Headers); 105if (httpRequest.Content != null) 107headers = headers.Concat(httpRequest.Content.Headers);
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageProperty.cs (2)
321HttpContent content = this.HttpRequestMessage.Content; 338HttpContent content = this.HttpRequestMessage.Content;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (1)
341throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(new ProtocolException(string.Format(SRServiceModel.FramingContentTypeMismatch, _httpRequestMessage.Content.Headers.ContentType.ToString(), _httpRequestMessage.RequestUri)));
Microsoft.AspNetCore.Authentication.Test (4)
FacebookTests.cs (1)
393var body = req.Content.ReadAsStringAsync().Result;
GoogleTests.cs (1)
1032var body = req.Content.ReadAsStringAsync().Result;
MicrosoftAccountTests.cs (1)
299var body = req.Content.ReadAsStringAsync().Result;
OpenIdConnect\OpenIdConnectChallengeTests.cs (1)
988var content = await request.Content.ReadAsStringAsync();
Microsoft.AspNetCore.HeaderPropagation (4)
HeaderPropagationMessageHandler.cs (4)
59var hasContent = request.Content != null; 62!(hasContent && request.Content!.Headers.TryGetValues(entry.OutboundHeaderName, out var _))) 72request.Content!.Headers.TryAddWithoutValidation(entry.OutboundHeaderName, value); 80request.Content!.Headers.TryAddWithoutValidation(entry.OutboundHeaderName, values);
Microsoft.AspNetCore.HeaderPropagation.Tests (1)
HeaderPropagationMessageHandlerTest.cs (1)
268Content = request.Content;
Microsoft.AspNetCore.HttpLogging.Tests (2)
HttpLoggingMiddlewareTests.cs (2)
1777request.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("text/plain"); 1867request.Content.Headers.ContentType = new System.Net.Http.Headers.MediaTypeHeaderValue("text/plain");
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Extensions\HttpClientExtensions.cs (1)
57submision.Content.Headers.TryAddWithoutValidation(header.Key, header.Value);
Microsoft.AspNetCore.Mvc.FunctionalTests (3)
SimpleWithWebApplicationBuilderTests.cs (2)
234request.Content.Headers.ContentType = new("application/xml"); 249request.Content.Headers.ContentType = new("application/xml");
TestingInfrastructureTests.cs (1)
83Assert.True(request.Content.Headers.TryAddWithoutValidation("X-Invalid-Content-Header", "Bearer 1234,5678"));
Microsoft.AspNetCore.Mvc.Testing (4)
Handlers\RedirectHandler.cs (4)
68if (request.Content == null) 72var originalRequestContent = request.Content; 78CopyContentHeaders(originalRequestContent, request.Content, contentCopy); 113var originalBody = await request.Content!.ReadAsStreamAsync();
Microsoft.AspNetCore.RequestDecompression.Tests (6)
RequestDecompressionMiddlewareTests.cs (6)
241request.Content.Headers.ContentEncoding.Add(contentEncoding); 312request.Content.Headers.ContentEncoding.Add(contentEncoding); 388request.Content.Headers.ContentEncoding.Add(contentEncoding); 490request.Content.Headers.ContentEncoding.Add(contentEncoding); 574request.Content.Headers.ContentEncoding.Add(contentEncoding); 730request.Content.Headers.ContentEncoding.Add(encoding);
Microsoft.AspNetCore.SignalR.Client.Tests (3)
LongPollingTransportTests.cs (2)
470sentRequests.Add(await request.Content.ReadAsByteArrayAsync()); 538sentRequests.Add(await request.Content.ReadAsByteArrayAsync());
TestHttpMessageHandler.cs (1)
244var data = await request.Content.ReadAsByteArrayAsync();
Microsoft.AspNetCore.SpaServices.Extensions (2)
Proxying\SpaProxy.cs (2)
152if (!requestMessage.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray()) && requestMessage.Content != null) 154requestMessage.Content?.Headers.TryAddWithoutValidation(header.Key, header.Value.ToArray());
Microsoft.AspNetCore.TestHost (3)
ClientHandler.cs (1)
82var requestContent = request.Content;
RequestBuilder.cs (2)
54if (_req.Content == null) 58if (!_req.Content.Headers.TryAddWithoutValidation(name, value))
Microsoft.AspNetCore.TestHost.Tests (3)
ClientHandlerTests.cs (1)
500message.Content.Dispose();
RequestBuilderTests.cs (2)
32Assert.NotNull(request.Content); 33Assert.Equal("Test/Value", request.Content.Headers.ContentType.ToString());
Microsoft.Extensions.Http (2)
Logging\LogHelper.cs (2)
108new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Request, request.Headers, request.Content?.Headers, shouldRedactHeaderValue), 147new HttpHeadersLogValue(HttpHeadersLogValue.Kind.Request, request.Headers, request.Content?.Headers, shouldRedactHeaderValue),
Microsoft.Extensions.Http.Diagnostics (5)
Logging\Internal\HttpHeadersReader.cs (2)
49if (_logContentHeaders && request.Content is not null) 51ReadHeaders(request.Content.Headers, _requestHeadersToLog, destination);
Logging\Internal\HttpRequestBodyReader.cs (3)
49if (request.Content == null || request.Method == HttpMethod.Get) 54var contentType = request.Content.Headers.ContentType; 90var streamToReadFrom = await request.Content!.ReadAsStreamAsync(cancellationToken).ConfigureAwait(false);
Microsoft.Extensions.Http.Diagnostics.Tests (1)
Logging\HttpRequestBodyReaderTest.cs (1)
189httpRequest.Content.Headers.Add("Content-type", "text/plain");
Microsoft.Extensions.Http.Resilience (2)
Internal\RequestMessageSnapshot.cs (2)
76if (request.Content is StreamContent) 84_content = request.Content;
Microsoft.Extensions.Http.Resilience.Tests (2)
Resilience\RequestMessageSnapshotTests.cs (2)
81Assert.Equal(initialRequest.Content, cloned.Content);
System.Net.Http (38)
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (2)
150string content = request.Content == null ? string.Empty : await request.Content.ReadAsStringAsync().ConfigureAwait(false);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (6)
1545if (request.Content == null) 1558headerListSize += WriteHeaderCollection(request, request.Content.Headers, ref headerBuffer); 1646await PerformWriteAsync(totalSize, (thisRef: this, http2Stream, headerBytes, endStream: (request.Content == null && !request.IsExtendedConnectRequest), mustFlush), static (s, writeBuffer) => 1993bool shouldExpectContinue = (request.Content != null && request.HasHeaders && request.Headers.ExpectContinue == true); 1996bool duplex = request.Content != null && request.Content.AllowDuplex;
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (6)
110if (_request.Content == null || _request.IsExtendedConnectRequest) 180if (_request.Content == null || _request.IsExtendedConnectRequest) 186if (NetEventSource.Log.IsEnabled()) Trace($"{_request.Content}"); 210using var writeStream = new Http2WriteStream(this, _request.Content.Headers.ContentLength.GetValueOrDefault(-1)); 214ValueTask vt = _request.Content.InternalCopyToAsync(writeStream, context: null, _requestBodyCancellationSource.Token); 335Debug.Assert(_request?.Content != null);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (10)
81_requestSendCompleted = _request.Content == null; 147bool duplex = _request.Content != null && _request.Content.AllowDuplex; 164if (_expect100ContinueCompletionSource != null || _request.Content == null) 172await FlushSendBufferAsync(endStream: _request.Content == null, _requestBodyCancellationSource.Token).ConfigureAwait(false); 175Task sendRequestTask = _request.Content != null 176? SendContentAsync(_request.Content, _requestBodyCancellationSource.Token) 188_request.Content?.AllowDuplex != true || 673if (request.Content == null) 683headerListSize += BufferHeaderCollection(request.Content.Headers);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (10)
381if (request.Content is HttpContent content) 560if (request.Content == null) 653if (request.Content is null || allowExpect100ToContinue is not null) 726request.Content != null && 727(request.Content.Headers.ContentLength == null || request.Content.Headers.ContentLength.GetValueOrDefault() > Expect100ErrorSendThreshold) && 944Debug.Assert(request.Content is not null); 948new ContentLengthWriteStream(this, request.Content.Headers.ContentLength.GetValueOrDefault()); 976await request.Content!.CopyToAsync(stream, _transportContext, cancellationToken).ConfigureAwait(false); 980request.Content!.CopyTo(stream, _transportContext, cancellationToken);
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (4)
641if (request.Content == null) 649request.Content.Headers.ContentLength = null; 651else if (request.Content != null && request.Content.Headers.ContentLength == null)
System.Net.Requests (1)
System\Net\HttpWebRequest.cs (1)
1201_sendRequestMessage.Content.Headers.TryAddWithoutValidation(headerName, _webHeaderCollection[headerName!]);