Member-only story
The Simple Guide to Porting C# Code for RestSharp Next v107 and Beyond
RestSharp made huge changes with the release of v107. It’s a major upgrade, which contains some breaking changes. For instance, most of the interfaces are now gone. For me, it meant all of our legacy API connection code broke without substantial rework if anyone updated NuGet packages in a project.
Personally, I feel there’s a bit of a versioning issue here which is solving and creating technical debt all at the same time. We’ve been using basically the same RestSharp code in production since our vendors moved to REST. This is the first change which has necessitated a major rewrite since we began testing this library when our company first started using C#.
Newer RestSharp requires some substantial adjustments to make everything work as expected with the newer versions. Let’s skip to what used to work, what it should be changed to, and what to take from this.
The Old Way Things Worked
I chose the specific API (I’m NDA’ed to not speak ill of our vendors by name) since it’s the least resilient to industry changes and the most frustrating for the most basic things. If I can make code work for this vendor, I can make it work anywhere.