@@ -35,16 +35,16 @@ namespace Seq.Api.Client
3535 /// <summary>
3636 /// A low-level client that provides navigation over the linked resource structure of the Seq HTTP API.
3737 /// </summary>
38- public class SeqApiClient : IDisposable
38+ public sealed class SeqApiClient : IDisposable
3939 {
4040 readonly string _apiKey ;
4141
42- // Future versions of Seq may not completely support v1 features, however
42+ // Future versions of Seq may not completely support vN-1 features, however
4343 // providing this as an Accept header will ensure what compatibility is available
4444 // can be utilized.
45- const string SeqApiV8MediaType = "application/vnd.datalust.seq.v8 +json" ;
45+ const string SeqApiV9MediaType = "application/vnd.datalust.seq.v9 +json" ;
4646
47- readonly CookieContainer _cookies = new CookieContainer ( ) ;
47+ readonly CookieContainer _cookies = new ( ) ;
4848 readonly JsonSerializer _serializer = JsonSerializer . Create (
4949 new JsonSerializerSettings
5050 {
@@ -89,7 +89,7 @@ public SeqApiClient(string serverUrl, string apiKey = null, Action<HttpClientHan
8989 baseAddress += "/" ;
9090
9191 HttpClient = new HttpClient ( handler ) { BaseAddress = new Uri ( baseAddress ) } ;
92- HttpClient . DefaultRequestHeaders . Accept . Add ( new MediaTypeWithQualityHeaderValue ( SeqApiV8MediaType ) ) ;
92+ HttpClient . DefaultRequestHeaders . Accept . Add ( new MediaTypeWithQualityHeaderValue ( SeqApiV9MediaType ) ) ;
9393
9494 if ( _apiKey != null )
9595 HttpClient . DefaultRequestHeaders . Add ( "X-Seq-ApiKey" , _apiKey ) ;
@@ -175,8 +175,8 @@ public async Task PostAsync<TEntity>(ILinked entity, string link, TEntity conten
175175 var linkUri = ResolveLink ( entity , link , parameters ) ;
176176 var request = new HttpRequestMessage ( HttpMethod . Post , linkUri ) { Content = MakeJsonContent ( content ) } ;
177177 var stream = await HttpSendAsync ( request , cancellationToken ) . ConfigureAwait ( false ) ;
178- using ( var reader = new StreamReader ( stream ) )
179- reader . ReadToEnd ( ) ;
178+ using var reader = new StreamReader ( stream ) ;
179+ await reader . ReadToEndAsync ( ) ;
180180 }
181181
182182 /// <summary>
@@ -213,8 +213,8 @@ public async Task<string> PostReadStringAsync<TEntity>(ILinked entity, string li
213213 var linkUri = ResolveLink ( entity , link , parameters ) ;
214214 var request = new HttpRequestMessage ( HttpMethod . Post , linkUri ) { Content = MakeJsonContent ( content ) } ;
215215 var stream = await HttpSendAsync ( request , cancellationToken ) . ConfigureAwait ( false ) ;
216- using ( var reader = new StreamReader ( stream ) )
217- return await reader . ReadToEndAsync ( ) ;
216+ using var reader = new StreamReader ( stream ) ;
217+ return await reader . ReadToEndAsync ( ) ;
218218 }
219219
220220 /// <summary>
0 commit comments