File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
WebApiClientCore/System.Net.Http Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1- using System . Reflection ;
1+ using System . Diagnostics . CodeAnalysis ;
2+ using System . Reflection ;
23using System . Runtime . CompilerServices ;
34using System . Text ;
45using System . Threading ;
@@ -24,7 +25,8 @@ public static class HttpContentExtensions
2425
2526 /// <summary>
2627 /// 静态构造器
27- /// </summary>
28+ /// </summary>
29+ [ DynamicDependency ( DynamicallyAccessedMemberTypes . NonPublicProperties , typeof ( HttpContent ) ) ]
2830 static HttpContentExtensions ( )
2931 {
3032 var property = typeof ( HttpContent ) . GetProperty ( IsBufferedPropertyName , BindingFlags . Instance | BindingFlags . NonPublic ) ;
@@ -70,8 +72,8 @@ public static void EnsureNotBuffered(this HttpContent httpContent)
7072 {
7173 throw new HttpContentBufferedException ( ) ;
7274 }
73- }
74-
75+ }
76+
7577 /// <summary>
7678 /// 读取为二进制数组并转换为 utf8 编码
7779 /// </summary>
@@ -133,7 +135,7 @@ public static Encoding GetEncoding(this HttpContent httpContent)
133135 return encoding . Equals ( Encoding . UTF8 . WebName , StringComparison . OrdinalIgnoreCase )
134136 ? Encoding . UTF8
135137 : Encoding . GetEncoding ( encoding . ToString ( ) ) ;
136- }
138+ }
137139
138140 }
139141}
You can’t perform that action at this time.
0 commit comments