Skip to content

v2.0.0

Compare
Choose a tag to compare
@bmazzarol bmazzarol released this 01 Oct 13:48
· 91 commits to main since this release

Reduce Allocations

I have gone through and removed all the unnecessary allocations that were occuring.

This has lead to a number of minor/but breaking changes.

Functions now Mutate

Before the code was cloning the Request/Response for every With method call.

Now it just mutates the Request/Response in-place.

If you require the old behaviour a Clone function is now public for both request and response.

var req = Req.Get.To("test").WithHeader("A","1");
var clonedReq = await req.Clone();
Assert.NotEqual(req, clonedReq);

Xml body function change

I have changed the spec for WithXmlContent, it now uses an internal XmlSerializer factory and the caller cannot pass one in.

If you need the old behaviour, you can use the raw WithContent and re-implement it using your own serializer.

I have also removed the defaultNamespace parameter, it was never the correct way to set the namespaces; use the standard attributes instead.

JsonTypeInfo Support

A JsonTypeInfo can now be passed to the WithJsonContent function if you have source generated JSON models

What's Changed

If you have any problems raise an issue and I will have a look.

Full Changelog: 1.1.3...2.0.0