Activout.RestClient.Xml
1.0.0
There is a newer prerelease version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Activout.RestClient.Xml --version 1.0.0
NuGet\Install-Package Activout.RestClient.Xml -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Activout.RestClient.Xml" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Activout.RestClient.Xml" Version="1.0.0" />
<PackageReference Include="Activout.RestClient.Xml" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Activout.RestClient.Xml --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Activout.RestClient.Xml, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Activout.RestClient.Xml@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Activout.RestClient.Xml&version=1.0.0
#tool nuget:?package=Activout.RestClient.Xml&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Activout.RestClient.Xml
This project is an extension to Activout.RestClient.
It provides support for XML serialization and deserialization.
Example usage
Add XML support from this package
var restClientFactory = Services.CreateRestClientFactory();
var xmlClient = restClientFactory
.CreateBuilder()
.WithXml() // Add XML support
.BaseUri(BaseUri)
.Build<IXmlMovieClient>();
var movie = await xmlClient.GetMovie(42);
await xmlClient.AddReview(42, new Review { Stars = 5, Text = "Great movie!" });
Make sure to add XML serialization attributes to the API model classes
Use attributes like XmlRoot, XmlElement, XmlArray, XmlArrayItem to control XML serialization and deserialization.
[XmlRoot("review")]
public class Review
{
[XmlElement("stars")]
public int Stars { get; set; }
[XmlElement("text")]
public string Text { get; set; }
}
[XmlRoot("movie")]
public class Movie
{
[XmlElement("id")]
public int Id { get; set; }
[XmlElement("title")]
public string Title { get; set; } = "";
[XmlArray("reviews")]
[XmlArrayItem("review")]
public Review[] Reviews { get; set; } = [];
}
[XmlRoot("movies")]
public class MoviesWrapper
{
[XmlElement("movie")]
public Movie[] Movies { get; set; } = [];
}
public interface IXmlMovieClient
{
[Get("movies/{id}")]
Task<Movie> GetMovie(int id);
[Get("movies")]
Task<MoviesWrapper> GetMovies();
[Post("movies/{id}/reviews")]
Task AddReview(int id, Review review);
}
Need help implementing Activout.RestClient?
Contact david@activout.se to order a support package, starting at 20000 SEK or 1800 EUR or 2000 USD.
License
About Activout
Activout AB is a software company in Ronneby, Sweden.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- Activout.RestClient (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 5.0.0-beta5 | 119 | 2/26/2026 | |
| 5.0.0-beta4 | 111 | 2/26/2026 | |
| 5.0.0-beta3 | 112 | 2/26/2026 | |
| 5.0.0-beta1 | 292 | 11/10/2025 | |
| 1.0.0 | 392 | 12/14/2024 |