File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -77,11 +77,16 @@ public static string GetCharSet(this IRequest request)
77
77
/// </summary>
78
78
/// <param name="postDataElement">post data</param>
79
79
/// <param name="charSet">character set</param>
80
- /// <returns>encoded string</returns>
80
+ /// <summary>
81
+ /// Decodes the byte content of a post data element into a string using the specified character set or the default encoding.
82
+ /// </summary>
83
+ /// <param name="postDataElement">The post data element containing the bytes to decode.</param>
84
+ /// <param name="charSet">Optional character set name to use for decoding. If invalid or not provided, the default encoding is used.</param>
85
+ /// <returns>The decoded string, or null if the byte content is null or empty.</returns>
81
86
public static string GetBody ( this IPostDataElement postDataElement , string charSet = null )
82
87
{
83
88
var bytes = postDataElement . Bytes ;
84
- if ( bytes . Length == 0 )
89
+ if ( bytes is null || bytes . Length == 0 )
85
90
{
86
91
return null ;
87
92
}
You can’t perform that action at this time.
0 commit comments