14 types derived from HttpContent
dotnet-svcutil-lib (1)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageContent.cs (1)
17internal abstract class MessageContent : HttpContent
NuGet.Protocol (1)
HttpSource\HttpRequestMessageExtensions.cs (1)
56internal class HttpContentWrapper : HttpContent
System.Net.Http (8)
System\Net\Http\ByteArrayContent.cs (1)
11public class ByteArrayContent : HttpContent
System\Net\Http\EmptyContent.cs (1)
11internal sealed class EmptyContent : HttpContent
System\Net\Http\MultipartContent.cs (2)
15public class MultipartContent : HttpContent, IEnumerable<HttpContent>
System\Net\Http\ReadOnlyMemoryContent.cs (1)
10public sealed class ReadOnlyMemoryContent : HttpContent
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (1)
139private abstract class DecompressedContent : HttpContent
System\Net\Http\SocketsHttpHandler\HttpConnectionResponseContent.cs (1)
11internal sealed class HttpConnectionResponseContent : HttpContent
System\Net\Http\StreamContent.cs (1)
13public class StreamContent : HttpContent
System.Net.Http.Json (1)
System\Net\Http\Json\JsonContent.cs (1)
16public sealed partial class JsonContent : HttpContent
System.Net.Http.WinHttpHandler (1)
System\Net\Http\NoWriteNoSeekStreamContent.cs (1)
13internal sealed class NoWriteNoSeekStreamContent : HttpContent
System.Net.Requests (1)
System\Net\RequestStreamContent.cs (1)
12internal sealed class RequestStreamContent(TaskCompletionSource<Stream> getStreamTcs, TaskCompletionSource completeTcs) : HttpContent
System.ServiceModel.Http (1)
System\ServiceModel\Channels\MessageContent.cs (1)
17internal abstract class MessageContent : HttpContent
115 references to HttpContent
Aspire.EndToEnd.Tests (1)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
533if (args.Outcome.Result?.Content is HttpContent content && (await content.ReadAsStringAsync()) is string contentStr)
Aspire.Templates.Tests (1)
tests\Shared\TemplatesTesting\AspireProject.cs (1)
533if (args.Outcome.Result?.Content is HttpContent content && (await content.ReadAsStringAsync()) is string contentStr)
Binding.Http.IntegrationTests (1)
BasicHttpBindingTests.4.0.0.cs (1)
162var oldContent = message.Content;
ConfigurationSchemaGenerator.Tests (1)
GeneratorTests.cs (1)
49MetadataReference.CreateFromFile(typeof(HttpContent).Assembly.Location)
dotnet-svcutil-lib (10)
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpRequestMessageProperty.cs (3)
321HttpContent content = this.HttpRequestMessage.Content; 338HttpContent content = this.HttpRequestMessage.Content; 343HttpContent newContent = new ByteArrayContent(Array.Empty<byte>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageHelper.cs (3)
129var content = _httpResponseMessage.Content; 168var content = _httpResponseMessage.Content; 291var content = _httpResponseMessage.Content;
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\HttpResponseMessageProperty.cs (3)
345HttpContent content = this.HttpResponseMessage.Content; 362HttpContent content = this.HttpResponseMessage.Content; 367HttpContent newContent = new ByteArrayContent(Array.Empty<byte>());
FrameworkFork\System.ServiceModel\System\ServiceModel\Channels\MessageContent.cs (1)
154internal static HttpContent Create(HttpChannelFactory<IRequestChannel> factory, Message request, TimeoutHelper _timeoutHelper)
Microsoft.Extensions.Http.Resilience (1)
Internal\RequestMessageSnapshot.cs (1)
23private HttpContent? _content;
Microsoft.ML.PerformanceTests (1)
ImageClassificationBench.cs (1)
230public static async Task ReadAsFileAsync(this HttpContent content, string filename, bool overwrite)
Microsoft.NET.Build.Containers (5)
Registry\DefaultBlobUploadOperations.cs (3)
85public async Task<NextChunkUploadInformation> UploadChunkAsync(Uri uploadUri, HttpContent content, CancellationToken cancellationToken) 94private HttpRequestMessage GetPatchHttpRequest(Uri uploadUri, HttpContent httpContent) 105private async Task<Uri> PatchAsync(Uri uploadUri, HttpContent content, CancellationToken cancellationToken)
Registry\DefaultManifestOperations.cs (1)
43HttpContent manifestUploadContent = new StringContent(manifestJson);
Registry\IBlobUploadOperations.cs (1)
43public Task<NextChunkUploadInformation> UploadChunkAsync(Uri uploadUri, HttpContent content, CancellationToken cancellationToken);
netstandard (1)
netstandard.cs (1)
1126[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Net.Http.HttpContent))]
NuGet.Protocol (2)
HttpSource\HttpRequestMessageExtensions.cs (2)
58private HttpContent _httpContent; 60public HttpContentWrapper(HttpContent httpContent)
System.Net.Http (67)
System\Net\Http\Headers\HttpContentHeaders.cs (2)
10internal HttpContent _parent; 109internal HttpContentHeaders(HttpContent parent)
System\Net\Http\HttpClient.cs (29)
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; 185HttpContent.LimitArrayPoolWriteStream? buffer = null; 194HttpContent c = response.Content; 203buffer = new HttpContent.LimitArrayPoolWriteStream( 213catch (Exception e) when (HttpContent.StreamCopyExceptionNeedsWrapping(e)) 215throw HttpContent.WrapStreamCopyException(e); 219return HttpContent.ReadBufferAsString(buffer, c.Headers); 259HttpContent.LimitArrayPoolWriteStream? buffer = null; 268HttpContent c = response.Content; 281buffer = new HttpContent.LimitArrayPoolWriteStream( 291catch (Exception e) when (HttpContent.StreamCopyExceptionNeedsWrapping(e)) 293throw HttpContent.WrapStreamCopyException(e); 342HttpContent c = response.Content; 384public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) => 387public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content) => 390public Task<HttpResponseMessage> PostAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) => 393public Task<HttpResponseMessage> PostAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken) 400public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) => 403public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content) => 406public Task<HttpResponseMessage> PutAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) => 409public Task<HttpResponseMessage> PutAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken) 416public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content) => 419public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content) => 422public Task<HttpResponseMessage> PatchAsync([StringSyntax(StringSyntaxAttribute.Uri)] string? requestUri, HttpContent? content, CancellationToken cancellationToken) => 425public Task<HttpResponseMessage> PatchAsync(Uri? requestUri, HttpContent? content, CancellationToken cancellationToken)
System\Net\Http\HttpClientHandler.cs (2)
245if (value > HttpContent.MaxBufferSize) 249HttpContent.MaxBufferSize));
System\Net\Http\HttpContent.cs (4)
306throw new NotSupportedException(SR.Format(SR.net_http_missing_sync_implementation, GetType(), nameof(HttpContent), nameof(SerializeToStream))); 407CancellationTokenRegistration cancellationRegistration = cancellationToken.Register(static s => ((HttpContent)s!).Dispose(), this); 602if (maxBufferSize > HttpContent.MaxBufferSize) 608SR.net_http_content_buffersize_limit, HttpContent.MaxBufferSize));
System\Net\Http\HttpProtocolException.cs (2)
15/// When calling <see cref="Stream"/> methods on the stream returned by <see cref="HttpContent.ReadAsStream()"/> or 16/// <see cref="HttpContent.ReadAsStreamAsync(Threading.CancellationToken)"/>, <see cref="HttpProtocolException"/> can be thrown directly.
System\Net\Http\HttpRequestMessage.cs (2)
33private HttpContent? _content; 62public HttpContent? Content
System\Net\Http\HttpResponseMessage.cs (2)
22private HttpContent? _content; 42public HttpContent Content
System\Net\Http\MultipartContent.cs (12)
28private readonly List<HttpContent> _nestedContent; 63_nestedContent = new List<HttpContent>(); 98public virtual void Add(HttpContent content) 113foreach (HttpContent content in _nestedContent) 126public IEnumerator<HttpContent> GetEnumerator() 148public HeaderEncodingSelector<HttpContent>? HeaderEncodingSelector { get; set; } 170HttpContent content = _nestedContent[contentIndex]; 215HttpContent content = _nestedContent[contentIndex]; 266HttpContent nestedContent = _nestedContent[contentIndex]; 308private void SerializeHeadersToStream(Stream stream, HttpContent content, bool writeDivider) 338private MemoryStream EncodeHeadersToNewStream(HttpContent content, bool writeDivider) 359foreach (HttpContent content in _nestedContent)
System\Net\Http\MultipartFormDataContent.cs (4)
26public override void Add(HttpContent content) 35public void Add(HttpContent content, string name) 43public void Add(HttpContent content, string name, string fileName) 52private void AddInternal(HttpContent content, string name, string? fileName)
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (6)
141private readonly HttpContent _originalContent; 144public DecompressedContent(HttpContent originalContent, string[] contentEncodings) 236private sealed class GZipDecompressedContent(HttpContent originalContent, string[] contentEncodings) : DecompressedContent(originalContent, contentEncodings) 242private sealed class DeflateDecompressedContent(HttpContent originalContent, string[] contentEncodings) : DecompressedContent(originalContent, contentEncodings) 444private sealed class BrotliDecompressedContent(HttpContent originalContent, string[] contentEncodings) : DecompressedContent(originalContent, contentEncodings) 450private sealed class ZstandardDecompressedContent(HttpContent originalContent, string[] contentEncodings) : DecompressedContent(originalContent, contentEncodings)
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (1)
446private async Task SendContentAsync(HttpContent content, CancellationToken cancellationToken)
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (1)
381if (request.Content is HttpContent content)
System.Net.Http.Json (18)
System\Net\Http\Json\HttpContentJsonExtensions.AsyncEnumerable.cs (5)
31this HttpContent content, 51this HttpContent content, 73this HttpContent content, 85HttpContent content, 94HttpContent content,
System\Net\Http\Json\HttpContentJsonExtensions.cs (11)
30public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken = default) 46public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, CancellationToken cancellationToken = default) 61public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, JsonSerializerOptions? options, CancellationToken cancellationToken = default) 77public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, CancellationToken cancellationToken = default) 84private static async Task<object?> ReadFromJsonAsyncCore(HttpContent content, Type type, JsonSerializerOptions? options, CancellationToken cancellationToken) 94private static async Task<T?> ReadFromJsonAsyncCore<T>(HttpContent content, JsonSerializerOptions? options, CancellationToken cancellationToken) 102public static Task<object?> ReadFromJsonAsync(this HttpContent content, Type type, JsonSerializerContext context, CancellationToken cancellationToken = default) 109public static Task<T?> ReadFromJsonAsync<T>(this HttpContent content, JsonTypeInfo<T> jsonTypeInfo, CancellationToken cancellationToken = default) 116private static async Task<object?> ReadFromJsonAsyncCore(HttpContent content, Type type, JsonSerializerContext context, CancellationToken cancellationToken) 124private static async Task<T?> ReadFromJsonAsyncCore<T>(HttpContent content, JsonTypeInfo<T> jsonTypeInfo, CancellationToken cancellationToken) 132internal static ValueTask<Stream> GetContentStreamAsync(HttpContent content, CancellationToken cancellationToken)
System\Net\Http\Json\HttpContentJsonExtensions.netcoreapp.cs (1)
13private static Task<Stream> ReadHttpContentStreamAsync(HttpContent content, CancellationToken cancellationToken)
System\Net\Http\Json\JsonHelpers.cs (1)
30internal static Encoding? GetEncoding(HttpContent content)
System.Net.Http.WinHttpHandler (1)
System\Net\Http\WinHttpHandler.cs (1)
668HttpContent? requestContent = requestMessage.Content;
System.Net.Requests (1)
System\Net\HttpWebRequest.cs (1)
1194private Task<HttpResponseMessage> SendRequest(bool async, HttpContent? content = null)
System.ServiceModel.Http (4)
System\ServiceModel\Channels\HttpResponseMessageHelper.cs (3)
132var content = _httpResponseMessage.Content; 171var content = _httpResponseMessage.Content; 309var content = _httpResponseMessage.Content;
System\ServiceModel\Channels\MessageContent.cs (1)
160internal static HttpContent Create(HttpChannelFactory<IRequestChannel> factory, Message request, TimeoutHelper _timeoutHelper)