Skip to content

Commit 7bcb04b

Browse files
authored
[Foundation] Document NSUrlSessionHandler.MaxInputInMemory. Fixes #21537. (#24305)
Fixes #21537.
1 parent 3f180ae commit 7bcb04b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/Foundation/NSUrlSessionHandler.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,9 +243,16 @@ void BackgroundNotificationCb (NSNotification obj)
243243
}
244244
#endif
245245

246-
/// <summary>To be added.</summary>
247-
/// <value>To be added.</value>
248-
/// <remarks>To be added.</remarks>
246+
/// <summary>The maximum amount of content to load into memory when sending content with a request.</summary>
247+
/// <value>The maximum size of content to load into memory.</value>
248+
/// <remarks>
249+
/// <para>When sending content with a request, the content can be provided either in memory, or in a streaming manner.</para>
250+
/// <para>If the content is provided in memory, the underlying NSURLSession will set the Content-Length header to the size of the content.</para>
251+
/// <para>If the content is provided in a streaming manner, the underlying NSURLSession will send the content using a chunked encoding, and the Content-Length header will not be set.</para>
252+
/// <para>This means that if a chunked encoding is not desirable, or a Content-Length header is required, then the content must be provided in memory.</para>
253+
/// <para>On the other hand, if upload progress is needed, it's required to provide the content in a streaming manner, and this can be forced by setting this property to 0.</para>
254+
/// <para>If the content to upload doesn't have a pre-determined length, then it will always be sent in a streaming manner.</para>
255+
/// </remarks>
249256
public long MaxInputInMemory { get; set; } = long.MaxValue;
250257

251258
void RemoveInflightData (NSUrlSessionTask task, bool cancel = true)

0 commit comments

Comments
 (0)