FlUrl does a great job in dealing with Json/UrlEncoded requests. However, the documentation doesn't really point out how to handle other request types such as text/xml
.
What's the best way to do an XML POST using FlUrl?
This (accessing underlying HttpClient
) kinda defeats the purpose of using FlUrl since you need to build the URI and content again:
var result = await "http://someUrl"
.AppendPathSegment(pathSegment)
.SetQueryParam("name", name)
.WithBasicAuth(_userName, _apiToken)
.HttpClient
.PostAsync(<uri>, <content>);