Skip to content

This repository demos different ways to implement REST clients for service-to-service communication. See my blog post for more information: https://bvkeersop.github.io/posts/rest_assured_c_edition/

Notifications You must be signed in to change notification settings

bvkeersop/RestClientExamples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RestClientExamples

This repository demos different ways to implement REST clients for service-to-service communication. See my blog post for detailed information.

The following implementations are demoed:

  1. Creating a REST client using Flurl.
  2. Manually creating a REST client.
  3. Generating a REST client using NSwag.
  4. Creating a REST client using Refit.
  5. Creating a REST client using RestEase.
  6. Creating a rest client using RestSharp.

You can open the solution in visual studio and run it, this will do the following:

  1. Start the RestClientExamples.ExampleApi.
  2. Start the RestClientExamples.Cli.
    • The Cli will prompt you to select an option:
      1. Demo making HTTP calls to the ExampleApi using the different types of clients.
      2. Execute a performance test using the different types of clients.

Inside the RestClientExamples solution you will find the following:

RestClientExamples.Cli

Contains a simple command line demo on how to use the clients.

RestClientExamples.ExampleApi

Contains an ExampleApi with the default WeatherForecastController.

RestClientExamples.ExampleApi.Models

Contains the Models used by the ExampleApi.

RestClientExamples.Flurl

Shows how you can use Flurl to make HTTP requests.

RestClientExamples.Manual

Shows how you can manually create a REST client using typed clients.

RestClientExamples.NSwag

Shows how you can leverage NSwag to automatically generate REST clients based on an openapi specification.

RestClientExamples.Refit

Shows how you can leverage Refit to generate a REST client using an interface.

RestClientExamples.RestEase

Shows how you can use RestEase to generate a REST client using an interface.

RestClientExamples.RestSharp

Shows how you can use RestSharp to make HTTP requests.

About

This repository demos different ways to implement REST clients for service-to-service communication. See my blog post for more information: https://bvkeersop.github.io/posts/rest_assured_c_edition/

Topics

Resources

Stars

Watchers

Forks

Languages