1515namespace Titanium . Web . Proxy . EventArguments
1616{
1717 /// <summary>
18- /// Holds info related to a single proxy session (single request/response sequence)
19- /// A proxy session is bounded to a single connection from client
18+ /// Holds info related to a single proxy session (single request/response sequence).
19+ /// A proxy session is bounded to a single connection from client.
2020 /// A proxy session ends when client terminates connection to proxy
21- /// or when server terminates connection from proxy
21+ /// or when server terminates connection from proxy.
2222 /// </summary>
2323 public class SessionEventArgs : SessionEventArgsBase
2424 {
@@ -47,7 +47,7 @@ protected SessionEventArgs(int bufferSize, ProxyEndPoint endPoint,
4747 private bool hasMulipartEventSubscribers => MultipartRequestPartSent != null ;
4848
4949 /// <summary>
50- /// Should we send the request again
50+ /// Should we send the request again ?
5151 /// </summary>
5252 public bool ReRequest
5353 {
@@ -346,9 +346,10 @@ private async Task<long> ReadUntilBoundaryAsync(CustomBinaryReader reader, long
346346 }
347347
348348 /// <summary>
349- /// Gets the request body as bytes
349+ /// Gets the request body as bytes.
350350 /// </summary>
351- /// <returns></returns>
351+ /// <param name="cancellationToken"></param>
352+ /// <returns>The body as bytes.</returns>
352353 public async Task < byte [ ] > GetRequestBody ( CancellationToken cancellationToken = default )
353354 {
354355 if ( ! WebSession . Request . IsBodyRead )
@@ -360,9 +361,10 @@ public async Task<byte[]> GetRequestBody(CancellationToken cancellationToken = d
360361 }
361362
362363 /// <summary>
363- /// Gets the request body as string
364+ /// Gets the request body as string.
364365 /// </summary>
365- /// <returns></returns>
366+ /// <param name="cancellationToken">Cancellation token for this async task is optional.</param>
367+ /// <returns>The body as string.</returns>
366368 public async Task < string > GetRequestBodyAsString ( CancellationToken cancellationToken = default )
367369 {
368370 if ( ! WebSession . Request . IsBodyRead )
@@ -374,9 +376,9 @@ public async Task<string> GetRequestBodyAsString(CancellationToken cancellationT
374376 }
375377
376378 /// <summary>
377- /// Sets the request body
379+ /// Sets the request body.
378380 /// </summary>
379- /// <param name="body"></param>
381+ /// <param name="body">The request body bytes. </param>
380382 public void SetRequestBody ( byte [ ] body )
381383 {
382384 var request = WebSession . Request ;
@@ -389,9 +391,9 @@ public void SetRequestBody(byte[] body)
389391 }
390392
391393 /// <summary>
392- /// Sets the body with the specified string
394+ /// Sets the body with the specified string.
393395 /// </summary>
394- /// <param name="body"></param>
396+ /// <param name="body">The request body string to set. </param>
395397 public void SetRequestBodyString ( string body )
396398 {
397399 if ( WebSession . Request . Locked )
@@ -403,7 +405,7 @@ public void SetRequestBodyString(string body)
403405 }
404406
405407 /// <summary>
406- /// Gets the response body as byte array
408+ /// Gets the response body as bytes.
407409 /// </summary>
408410 /// <returns></returns>
409411 public async Task < byte [ ] > GetResponseBody ( CancellationToken cancellationToken = default )
@@ -417,9 +419,9 @@ public async Task<byte[]> GetResponseBody(CancellationToken cancellationToken =
417419 }
418420
419421 /// <summary>
420- /// Gets the response body as string
422+ /// Gets the response body as string.
421423 /// </summary>
422- /// <returns></returns>
424+ /// <returns>The string body. </returns>
423425 public async Task < string > GetResponseBodyAsString ( CancellationToken cancellationToken = default )
424426 {
425427 if ( ! WebSession . Response . IsBodyRead )
@@ -431,7 +433,7 @@ public async Task<string> GetResponseBodyAsString(CancellationToken cancellation
431433 }
432434
433435 /// <summary>
434- /// Set the response body bytes
436+ /// Set the response body bytes.
435437 /// </summary>
436438 /// <param name="body"></param>
437439 public void SetResponseBody ( byte [ ] body )
@@ -446,7 +448,7 @@ public void SetResponseBody(byte[] body)
446448 }
447449
448450 /// <summary>
449- /// Replace the response body with the specified string
451+ /// Replace the response body with the specified string.
450452 /// </summary>
451453 /// <param name="body"></param>
452454 public void SetResponseBodyString ( string body )
@@ -462,9 +464,8 @@ public void SetResponseBodyString(string body)
462464 }
463465
464466 /// <summary>
465- /// Before request is made to server
466- /// Respond with the specified HTML string to client
467- /// and ignore the request
467+ /// Before request is made to server respond with the specified HTML string to client
468+ /// and ignore the request.
468469 /// </summary>
469470 /// <param name="html"></param>
470471 /// <param name="headers"></param>
@@ -483,9 +484,8 @@ public void Ok(string html, Dictionary<string, HttpHeader> headers = null)
483484 }
484485
485486 /// <summary>
486- /// Before request is made to server
487- /// Respond with the specified byte[] to client
488- /// and ignore the request
487+ /// Before request is made to server respond with the specified byte[] to client
488+ /// and ignore the request.
489489 /// </summary>
490490 /// <param name="result"></param>
491491 /// <param name="headers"></param>
@@ -501,9 +501,8 @@ public void Ok(byte[] result, Dictionary<string, HttpHeader> headers = null)
501501
502502 /// <summary>
503503 /// Before request is made to server
504- /// Respond with the specified HTML string to client
505- /// and the specified status
506- /// and ignore the request
504+ /// respond with the specified HTML string and the specified status to client.
505+ /// And then ignore the request.
507506 /// </summary>
508507 /// <param name="html"></param>
509508 /// <param name="status"></param>
@@ -520,10 +519,8 @@ public void GenericResponse(string html, HttpStatusCode status, Dictionary<strin
520519 }
521520
522521 /// <summary>
523- /// Before request is made to server
524- /// Respond with the specified byte[] to client
525- /// and the specified status
526- /// and ignore the request
522+ /// Before request is made to server respond with the specified byte[],
523+ /// the specified status to client. And then ignore the request.
527524 /// </summary>
528525 /// <param name="result"></param>
529526 /// <param name="status"></param>
@@ -540,7 +537,7 @@ public void GenericResponse(byte[] result, HttpStatusCode status, Dictionary<str
540537 }
541538
542539 /// <summary>
543- /// Redirect to URL.
540+ /// Redirect to provided URL.
544541 /// </summary>
545542 /// <param name="url"></param>
546543 /// <returns></returns>
0 commit comments