@@ -39,6 +39,9 @@ public static async Task<Response> GetAsync(string endpoint, Header[]? headers =
3939 return new Response { IsSuccessful = response . IsSuccessStatusCode , Body = response . Content . ReadAsStringAsync ( ) . Result , Headers = new Dictionary < string , IEnumerable < string > > ( response . Headers . ToDictionary ( ) , StringComparer . OrdinalIgnoreCase ) , StatusCode = response . StatusCode } ;
4040 }
4141
42+ /// <summary>
43+ /// Synchronous version of <see cref="GetAsync"/>
44+ /// </summary>
4245 public static Response Get ( string endpoint , Header [ ] ? headers = null ) => GetAsync ( endpoint , headers ) . GetAwaiter ( ) . GetResult ( ) ;
4346
4447 private static async Task < Response > BodyRequest ( string endpoint , HttpMethod method , string body , Header [ ] ? headers , string contentType ) {
@@ -76,6 +79,9 @@ private static async Task<Response> BodyRequest(string endpoint, HttpMethod meth
7679 /// <returns><see cref="Response"/></returns>
7780 public static async Task < Response > DeleteAsync ( string endpoint , string body , Header [ ] ? headers = null , string contentType = "application/json" ) => await BodyRequest ( endpoint , HttpMethod . Delete , body , headers , contentType ) ;
7881
82+ /// <summary>
83+ /// Synchronous version of <see cref="DeleteAsync"/>
84+ /// </summary>
7985 public static Response Delete ( string endpoint , string body , Header [ ] ? headers = null , string contentType = "application/json" ) => DeleteAsync ( endpoint , body , headers , contentType ) . GetAwaiter ( ) . GetResult ( ) ;
8086
8187 /// <summary>
@@ -88,6 +94,9 @@ private static async Task<Response> BodyRequest(string endpoint, HttpMethod meth
8894 /// <returns><see cref="Response"/></returns>
8995 public static async Task < Response > PatchAsync ( string endpoint , string body , Header [ ] ? headers = null , string contentType = "application/json" ) => await BodyRequest ( endpoint , HttpMethod . Patch , body , headers , contentType ) ;
9096
97+ /// <summary>
98+ /// Synchronous version of <see cref="PatchAsync"/>
99+ /// </summary>
91100 public static Response Patch ( string endpoint , string body , Header [ ] ? headers = null , string contentType = "application/json" ) => PatchAsync ( endpoint , body , headers , contentType ) . GetAwaiter ( ) . GetResult ( ) ;
92101
93102 /// <summary>
@@ -100,6 +109,9 @@ private static async Task<Response> BodyRequest(string endpoint, HttpMethod meth
100109 /// <returns><see cref="Response"/></returns>
101110 public static async Task < Response > PostAsync ( string endpoint , string body , Header [ ] ? headers = null , string contentType = "application/json" ) => await BodyRequest ( endpoint , HttpMethod . Post , body , headers , contentType ) ;
102111
112+ /// <summary>
113+ /// Synchronous version of <see cref="PostAsync"/>
114+ /// </summary>
103115 public static Response Post ( string endpoint , string body , Header [ ] ? headers = null , string contentType = "application/json" ) => PostAsync ( endpoint , body , headers , contentType ) . GetAwaiter ( ) . GetResult ( ) ;
104116
105117 /// <summary>
@@ -112,5 +124,8 @@ private static async Task<Response> BodyRequest(string endpoint, HttpMethod meth
112124 /// <returns><see cref="Response"/></returns>
113125 public static async Task < Response > PutAsync ( string endpoint , string body , Header [ ] ? headers = null , string contentType = "application/json" ) => await BodyRequest ( endpoint , HttpMethod . Put , body , headers , contentType ) ;
114126
127+ /// <summary>
128+ /// Synchronous version of <see cref="PutAsync"/>
129+ /// </summary>
115130 public static Response Put ( string endpoint , string body , Header [ ] ? headers = null , string contentType = "application/json" ) => PutAsync ( endpoint , body , headers , contentType ) . GetAwaiter ( ) . GetResult ( ) ;
116131}
0 commit comments