Skip to content

fond-of-vertigo/vrest

Repository files navigation

vrest

Simple REST client inspired by the great resty lib.

Why another rest lib?

We really like the API of resty, but there are a few reasons why we created our own lib:

  1. No dependencies: vrest has no dependencies.

  2. Efficient memory usage: We don't want a rest lib to copy body bytes. The lib user should be in control. vrest gives you access to the body bytes (if available).

  3. HTTP abstraction: We want to abstract the HTTP layer away, so there is only one error return value, no HTTP response handling required.

  4. Limited scope: This lib only covers default rest APIs with JSON and XML. We don't plan to add support for handling HTML related stuff like form data or multipart file uploads.

  5. Improved logging/tracing: Tracing requests was designed with Open Telemetry in mind. There is full access to all request/response data.

  6. No data hiding: We provide full access to all internal data in callbacks. You can break things, if you want, so please look at the examples how to perform advanced tasks like overwriting vrest functions.

  7. Configurability: Many configurable settings and replaceable functions. Most settings can be set in client (default for all requests) and each request to override client defaults.

  8. Easy testing: It is easy to replace functions in vrest. There are also some helper functions to mock responses.