FlurlX.Http.Xml 1.0.0

dotnet add package FlurlX.Http.Xml --version 1.0.0
NuGet\Install-Package FlurlX.Http.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="FlurlX.Http.Xml" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add FlurlX.Http.Xml --version 1.0.0
#r "nuget: FlurlX.Http.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.
// Install FlurlX.Http.Xml as a Cake Addin
#addin nuget:?package=FlurlX.Http.Xml&version=1.0.0

// Install FlurlX.Http.Xml as a Cake Tool
#tool nuget:?package=FlurlX.Http.Xml&version=1.0.0

Icon

FlurlX.Http.Xml

Build status license NuGet downloads alternate text is missing from this package README image

XML extension to the excellent Flurl 4 library

Features:

  • Get, post and receive XML models
  • Receive XDocument
  • Receive XElements with XPath

Usage:

  • Get an XDocument:
    var result = await "https://query.yahooapis.com/v1/public/yql"
        .SetQueryParam("q", "select wind from weather.forecast where woeid=2460286")
        .SetQueryParam("format", "xml")
        .GetXDocumentAsync();

    string chill = result
        ?.Element("query")
        ?.Element("results")
        ?.Element("channel")
        ?.Element(XNamespace.Get("http://xml.weather.yahoo.com/ns/rss/1.0") + "wind")
        ?.Attribute("chill")
        ?.Value;
  • Post and receive a model:
    var result = await "http://my_xml_endpoint"
        .PostXmlAsync(new TestModel { Number = 3, Text = "Test" })
        .ReceiveXml<TestModel>();

    Assert.AreEqual(3, result.Number);
    Assert.AreEqual("Test", result.Text);
  • Put a model and receive an XDocument:
    var result = await "http://my_xml_endpoint"
        .PutXmlAsync(new TestModel {Number = 3, Text = "Test"})
        .ReceiveXDocument();

    Assert.AreEqual("3", result?.Element("TestModel")?.Element("Number")?.Value);
    Assert.AreEqual("Test", result?.Element("TestModel")?.Element("Text")?.Value);

Thanks

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
1.0.0 240 12/16/2023