-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f6be96c
commit 78d7d0b
Showing
7 changed files
with
79 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# About | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# About | ||
|
||
This library allows using Newtonsoft.Json as a serializer for RestSharp instead of the default JSON serializer based | ||
on `System.Text.Json`. | ||
|
||
# How to use | ||
|
||
The default JSON serializer uses `System.Text.Json`, which is a part of .NET since .NET 6. | ||
|
||
If you want to use Newtonsoft.Json, you can install the `RestSharp.Serializers.NewtonsoftJson` package and configure | ||
the | ||
client to use it: | ||
|
||
```csharp | ||
var client = new RestClient( | ||
options, | ||
configureSerialization: s => s.UseNewtonsoftJson() | ||
); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# About | ||
|
||
This package is a custom XML serializer for RestSharp. It is based on the original XML serializer that was part of RestSharp but was removed in version 107.0.0. | ||
|
||
# How to use | ||
|
||
The default XML serializer in RestSharp is `DotNetXmlSerializer`, which uses `System.Xml.Serialization` library from . | ||
NET. | ||
|
||
In previous versions of RestSharp, the default XML serializer was a custom RestSharp XML serializer. To make the | ||
code library size smaller, the custom serializer was removed from RestSharp. | ||
|
||
You can add it back if necessary by installing the `RestSharp.Serializers.Xml` package and adding it to the client: | ||
|
||
```csharp | ||
var client = new RestClient( | ||
options, | ||
configureSerialization: s => s.UseXmlSerializer() | ||
); | ||
``` | ||
|
||
As before, you can supply three optional arguments for a custom namespace, custom root element, and if you want to use `SerializeAs` and `DeserializeAs` attributed. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters