Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5668570
Add documentation to `WebHeaderCollection`
FilipToth Aug 19, 2021
8d18587
Add type parameter description to `HeaderEncodingSelector<TContext>`
FilipToth Aug 20, 2021
2ad9439
Add documentation for `CreateContentReadStream` method
FilipToth Aug 20, 2021
b845ac5
Add summary to `Options` property of `HttpRequestMessage` class
FilipToth Aug 20, 2021
20da612
Add summary for `HttpRequestOptions` class
FilipToth Aug 20, 2021
6c5b8c1
Add documentation for `Set<TValue>` method of `HttpRequestOptions` class
FilipToth Aug 20, 2021
651ea56
Change wording of `Set<TValue>` method summary
FilipToth Aug 20, 2021
a866640
Add documentation for `TryGetValue` method of `HttpRequestOptions` class
FilipToth Aug 20, 2021
239f510
Fix trailing whitespaces in XML comments
FilipToth Aug 20, 2021
0bb7613
Remove trailing whitespaces
FilipToth Aug 21, 2021
963136a
Add summary to `HttpRequestOptionsKey`
FilipToth Aug 21, 2021
a7e7e3d
Add documentation `HttpRequestOptionsKey`
FilipToth Aug 21, 2021
7197240
Add documentation to `NegotiateStream.WriteAsync` methods
FilipToth Aug 22, 2021
246f412
Fix `cref` attribute
FilipToth Aug 22, 2021
1c747a4
Add documentation to `\BrowserHttpHandler\SocketsHttpHandler.cs`
FilipToth Aug 22, 2021
9da47bb
Add documentation to `SocketsHttpHandler` properties
FilipToth Aug 22, 2021
ec22eeb
Better documentation for `WriteAsync` methods
FilipToth Aug 23, 2021
75973ad
Remove duplicate documentation
FilipToth Aug 25, 2021
f3a4fe9
Remove duplicate documentation
FilipToth Aug 25, 2021
086d28b
Merge branch 'System.Net-Docs' of https://github.com/FilipToth/runtim…
FilipToth Aug 25, 2021
8190cdd
Minor tweaks and fix test failures
FilipToth Aug 28, 2021
a6397b5
Add some removed documentation
FilipToth Aug 30, 2021
64e13aa
Make changes according to review
FilipToth Sep 2, 2021
38721b6
Make changes according to review
FilipToth Sep 7, 2021
d856605
Add documentation to SocketsHttpHandler.CookieContainer
FilipToth Sep 7, 2021
a193171
Removed options docs, cleaned up the rest
ManickaP Sep 8, 2021
845d160
Updated Properties summary
ManickaP Sep 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ namespace System.Net.Http
/// Represents a method that specifies the <see cref="Encoding"/> to use when interpreting header values.
/// </summary>
/// <param name="headerName">Name of the header to specify the <see cref="Encoding"/> for.</param>
/// <param name="context">The <typeparamref name="TContext"/> we are enoding/decoding the headers for.</param>
/// <param name="context">The <typeparamref name="TContext"/> we are encoding/decoding the headers for.</param>
/// <typeparam name="TContext">The type which headers are being encoded/decoded;</typeparam>
/// <returns><see cref="Encoding"/> to use or <see langword="null"/> to use the default behavior.</returns>
public delegate Encoding? HeaderEncodingSelector<TContext>(string headerName, TContext context);
}
11 changes: 11 additions & 0 deletions src/libraries/System.Net.Http/src/System/Net/Http/HttpContent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,17 @@ private async Task LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStr
}
}

/// <summary>
/// Serializes the HTTP content to a memory stream.
/// </summary>
Comment thread
ManickaP marked this conversation as resolved.
/// <param name="cancellationToken">The cancellation token to cancel the operation.</param>
/// <returns>The output memory stream which contains the serialized HTTP content.</returns>
/// <remarks>
/// Once the operation completes, the returned memory stream represents the HTTP content. The returned stream can then be used to read the content using various stream APIs.
/// The <see cref="CreateContentReadStream(CancellationToken)"/> method buffers the content to a memory stream.
/// Derived classes can override this behavior if there is a better way to retrieve the content as stream.
/// For example, a byte array or a string could use a more efficient method way such as wrapping a read-only MemoryStream around the bytes or string.
/// </remarks>
protected virtual Stream CreateContentReadStream(CancellationToken cancellationToken)
{
LoadIntoBuffer(MaxBufferSize, cancellationToken);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,9 @@ public Func<SocketsHttpPlaintextStreamFilterContext, CancellationToken, ValueTas
}
}

/// <summary>
/// Gets a writable dictionary (that is, a map) of custom properties for the HttpClient requests. The dictionary is initialized empty; you can insert and query key-value pairs for your custom handlers and special processing.
/// </summary>
public IDictionary<string, object?> Properties =>
_settings._properties ?? (_settings._properties = new Dictionary<string, object?>());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,7 @@ public override void Write(byte[] buffer, int offset, int count)
WriteAsync(new SyncReadWriteAdapter(InnerStream), new ReadOnlyMemory<byte>(buffer, offset, count)).GetAwaiter().GetResult();
}

/// <returns>A <see cref="Task"/> that represents the asynchronous read operation.</returns>
public override Task WriteAsync(byte[] buffer, int offset, int count, CancellationToken cancellationToken)
{
ValidateBufferArguments(buffer, offset, count);
Expand All @@ -473,6 +474,7 @@ public override Task WriteAsync(byte[] buffer, int offset, int count, Cancellati
return WriteAsync(new AsyncReadWriteAdapter(InnerStream, cancellationToken), new ReadOnlyMemory<byte>(buffer, offset, count));
}

/// <returns>A <see cref="ValueTask"/> that represents the asynchronous read operation.</returns>
public override ValueTask WriteAsync(ReadOnlyMemory<byte> buffer, CancellationToken cancellationToken = default)
{
ThrowIfFailed(authSuccessCheck: true);
Expand Down