Quick Look – RestSharp

It is very common to make REST API calls as part of our applications today. REST APIs are probably the most common API flavor out there. The ease of interacting with REST APIs is perhaps the biggest driver for REST APIs becoming so popular.

You can make REST API calls using pretty low-level tools in pretty much any language, which makes a REST API something that is very handy.

Even though REST APIs can be called using low-level APIs, it doesn’t mean we can’t find tools that make interacting with them better and easier. That is what makes RestSharp so interesting.

RestSharp is a .NET library that makes consuming REST APIs less awkward and more pleasant to work with. Instead of manufacturing an HTTP call, you are just making a REST API call.


Here is some code that pulls time logs written using some low-level APIs in .NET.

Now here is the same code rewritten to use RestSharp.

While neither code is particularly difficult to understand, the RestSharp code abstracts away more of the plumbing necessary to make a REST API call.


Related posts