You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Change HttpClientBase.ExecutePost to match upstream better and drop Newtonsoft.Json dependency (#1212)
* Change HttpClientBase.ExecutePost to match upstream better and drop Newtonsoft.Json dependency
* Code cleanup of HttpClientBase and HttpReplicator, remove NewtonsoftJson dependency version
---------
Co-authored-by: Paul Irwin <paulirwin@gmail.com>
Copy file name to clipboardExpand all lines: src/Lucene.Net.Replicator/Http/HttpClientBase.cs
+33-34Lines changed: 33 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -1,15 +1,13 @@
1
1
usingLucene.Net.Diagnostics;
2
2
usingLucene.Net.Support;
3
-
usingNewtonsoft.Json;
4
-
usingNewtonsoft.Json.Linq;
5
3
usingSystem;
6
4
usingSystem.IO;
7
5
usingSystem.Linq;
8
6
usingSystem.Net;
9
7
usingSystem.Net.Http;
10
-
usingSystem.Text;
11
8
usingSystem.Threading;
12
9
usingSystem.Threading.Tasks;
10
+
#nullable enable
13
11
14
12
namespaceLucene.Net.Replicator.Http
15
13
{
@@ -47,7 +45,7 @@ public abstract class HttpClientBase : IDisposable
47
45
/// Default request timeout for this client (100 seconds).
48
46
/// <see cref="Timeout"/>.
49
47
/// </summary>
50
-
publicreadonlystaticTimeSpanDEFAULT_TIMEOUT=TimeSpan.FromSeconds(100);// LUCENENET: This was DEFAULT_SO_TIMEOUT in Lucene, using .NET's default timeout value of 100 instead of 61 seconds
48
+
publicstaticreadonlyTimeSpanDEFAULT_TIMEOUT=TimeSpan.FromSeconds(100);// LUCENENET: This was DEFAULT_SO_TIMEOUT in Lucene, using .NET's default timeout value of 100 instead of 61 seconds
51
49
52
50
// TODO compression?
53
51
@@ -56,7 +54,8 @@ public abstract class HttpClientBase : IDisposable
56
54
/// </summary>
57
55
protectedstringUrl{get;privateset;}
58
56
59
-
privatevolatileboolisDisposed=false;
57
+
privatevolatileboolisDisposed;
58
+
60
59
privatereadonlyHttpClienthttpc;
61
60
62
61
/// <summary>
@@ -73,7 +72,7 @@ public abstract class HttpClientBase : IDisposable
73
72
/// <param name="port">The port to be used to connect on.</param>
74
73
/// <param name="path">The path to the replicator on the host.</param>
75
74
/// <param name="messageHandler">Optional, The HTTP handler stack to use for sending requests, defaults to <c>null</c>.</param>
/// Creates a new <see cref="HttpClientBase"/> with the given <paramref name="url"/> and <see cref="HttpClient"/>.
98
97
/// </summary>
99
98
/// <remarks>
100
-
/// This allows full controll over how the <see cref="HttpClient"/> is created,
99
+
/// This allows full control over how the <see cref="HttpClient"/> is created,
101
100
/// prefer the <see cref="HttpClientBase(string, HttpMessageHandler)"/> over this unless you know you need the control of the <see cref="HttpClient"/>.
0 commit comments