23 types derived from HttpContent
dotnet-svcutil-lib (1)
HttpStress (3)
Interop.FunctionalTests (3)
Microsoft.AspNetCore.Http.Connections.Client (1)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (3)
Microsoft.AspNetCore.TestHost.Tests (2)
Microsoft.Build.Tasks.UnitTests (1)
System.Net.Http (8)
System.Net.Http.Json (1)
136 references to HttpContent
Aspire.EndToEnd.Tests (1)
Aspire.Workload.Tests (1)
Binding.Http.IntegrationTests (1)
ConfigurationSchemaGenerator.Tests (1)
dotnet-svcutil-lib (10)
InMemory.FunctionalTests (2)
Interop.FunctionalTests (1)
Microsoft.AspNetCore.HeaderPropagation.Tests (1)
Microsoft.AspNetCore.Http.Extensions.Tests (12)
RequestDelegateGenerator\RequestDelegateCreationTests.Forms.cs (10)
513public static TheoryData<HttpContent, string> FormContent
517var dataset = new TheoryData<HttpContent, string>();
533public async Task RequestDelegatePopulatesFromIFormCollectionParameter(HttpContent content, string contentType)
580public async Task RequestDelegatePopulatesFromIFormCollectionParameterWithAttribute(HttpContent content, string contentType)
627public async Task RequestDelegatePopulatesFromOptionalFormParameter(HttpContent content, string contentType)
655public async Task RequestDelegatePopulatesFromMultipleRequiredFormParameters(HttpContent content, string contentType)
688public async Task RequestDelegatePopulatesFromOptionalMissingFormParameter(HttpContent content, string contentType)
719public async Task RequestDelegatePopulatesFromFormParameterWithMetadata(HttpContent content, string contentType)
748public async Task RequestDelegatePopulatesFromFormAndBoundParameter(HttpContent content, string contentType)
858public async Task RequestDelegateSets400ResponseIfRequiredFormItemNotSpecified(HttpContent content, string contentType)
Microsoft.AspNetCore.InternalTesting (2)
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
Microsoft.AspNetCore.Mvc.Testing (7)
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (3)
Microsoft.AspNetCore.SignalR.Client.Tests (1)
Microsoft.AspNetCore.TestHost (1)
Microsoft.Extensions.Http.Resilience (1)
Microsoft.ML.PerformanceTests (1)
netstandard (1)
ServerComparison.FunctionalTests (1)
System.Net.Http (67)
System\Net\Http\HttpClient.cs (30)
65/// e.g.: <see cref="GetAsync(string?)" />, <see cref="PostAsync(string?, HttpContent)" />.
121if (value > HttpContent.MaxBufferSize)
125SR.net_http_content_buffersize_limit, HttpContent.MaxBufferSize));
129Debug.Assert(HttpContent.MaxBufferSize <= int.MaxValue);
149_maxResponseContentBufferSize = HttpContent.MaxBufferSize;
193HttpContent c = response.Content;
203using var buffer = new HttpContent.LimitArrayPoolWriteStream(_maxResponseContentBufferSize, (int)c.Headers.ContentLength.GetValueOrDefault());
209catch (Exception e) when (HttpContent.StreamCopyExceptionNeedsWrapping(e))
211throw HttpContent.WrapStreamCopyException(e);
217return HttpContent.ReadBufferAsString(buffer.GetBuffer(), c.Headers);
268HttpContent c = response.Content;
284new HttpContent.LimitMemoryStream(_maxResponseContentBufferSize, (int)contentLength.GetValueOrDefault()) :
285new HttpContent.LimitArrayPoolWriteStream(_maxResponseContentBufferSize);
292catch (Exception e) when (HttpContent.StreamCopyExceptionNeedsWrapping(e))
294throw HttpContent.WrapStreamCopyException(e);
299buffer is HttpContent.LimitMemoryStream lms ? lms.GetSizedBuffer() :
300((HttpContent.LimitArrayPoolWriteStream)buffer).ToArray();
345HttpContent c = response.Content;
387public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
390public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content) =>
393public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
396public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
403public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
406public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content) =>
409public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
412public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
419public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) =>
422public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content) =>
425public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) =>
428public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
System.Net.Http.Json (18)
System\Net\Http\Json\HttpContentJsonExtensions.cs (11)
30public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
49public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, CancellationToken cancellationToken = default)
64public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, JsonSerializerOptions? options, CancellationToken cancellationToken = default)
83public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, CancellationToken cancellationToken = default)
90private static async Task<object?> ReadFromJsonAsyncCore(HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken)
100private static async Task<T?> ReadFromJsonAsyncCore<T>(HttpContent content, JsonSerializerOptions? options, CancellationToken cancellationToken)
108public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default)
118public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, JsonTypeInfo<T> jsonTypeInfo, CancellationToken cancellationToken = default)
128private static async Task<object?> ReadFromJsonAsyncCore(HttpContent content, Type type, JsonSerializerContext context, CancellationToken cancellationToken)
136private static async Task<T?> ReadFromJsonAsyncCore<T>(HttpContent content, JsonTypeInfo<T> jsonTypeInfo, CancellationToken cancellationToken)
144internal static ValueTask<Stream> GetContentStreamAsync(HttpContent content, CancellationToken cancellationToken)
System.Net.Requests (2)