Commit 4e79a50 1 parent 4476552 commit 4e79a50 Copy full SHA for 4e79a50
File tree 2 files changed +15
-21
lines changed
src/Rqlite.Internal/Request
2 files changed +15
-21
lines changed Original file line number Diff line number Diff line change @@ -10,22 +10,19 @@ namespace Rqlite.Internal.Request;
10
10
/// <summary>
11
11
/// Serialises and encodes JSON content correctly for use in HttpRequestMessage.
12
12
/// </summary>
13
- public sealed class JsonContent : StringContent
13
+ /// <remarks>
14
+ /// Serialise content and set encoding.
15
+ /// </remarks>
16
+ /// <param name="content">Content to be serialised as JSON.</param>
17
+ public sealed class JsonContent ( object ? content ) : StringContent (
18
+ content : JsonSerializer . Serialize ( content , SerialiserOptions ) ,
19
+ encoding : Encoding . UTF8 ,
20
+ mediaType : "application/json"
21
+ )
14
22
{
15
23
/// <summary>
16
24
/// Shared options for JSON serialisation.
17
25
/// </summary>
18
26
public static JsonSerializerOptions SerialiserOptions { get ; } =
19
27
new JsonSerializerOptions { PropertyNameCaseInsensitive = true } ;
20
-
21
- /// <summary>
22
- /// Serialise content and set encoding.
23
- /// </summary>
24
- /// <param name="content">Content to be serialised as JSON.</param>
25
- public JsonContent ( object ? content ) : base (
26
- content : JsonSerializer . Serialize ( content , SerialiserOptions ) ,
27
- encoding : Encoding . UTF8 ,
28
- mediaType : "application/json"
29
- )
30
- { }
31
28
}
Original file line number Diff line number Diff line change 8
8
namespace Rqlite . Internal . Request ;
9
9
10
10
/// <inheritdoc cref="IUriBuilder"/>
11
- public sealed class UriBuilder : IUriBuilder
11
+ /// <summary>
12
+ /// Create builder with a URI path.
13
+ /// </summary>
14
+ /// <param name="path">URI path.</param>
15
+ public sealed class UriBuilder ( string path ) : IUriBuilder
12
16
{
13
17
/// <inheritdoc/>
14
- public string Path { get ; }
18
+ public string Path { get ; } = path . TrimStart ( '/' ) ;
15
19
16
20
/// <inheritdoc/>
17
21
public NameValueCollection QueryVars { get ; } = [ ] ;
18
22
19
- /// <summary>
20
- /// Create builder with a URI path.
21
- /// </summary>
22
- /// <param name="path">URI path.</param>
23
- public UriBuilder ( string path ) =>
24
- Path = path . TrimStart ( '/' ) ;
25
-
26
23
/// <summary>
27
24
/// Create builder and optionally include timings with all requests.
28
25
/// </summary>
You can’t perform that action at this time.
0 commit comments