(C# ASP.NET Core) Introduction to HttpRepl for Testing Web Api

Http Repl is a command-line tool for testing web api. This tool targets the ASP.NET Core environment. Let's have a look at a brief introduction to this tool. We will also learn how to activate it in visual studio. And in the coming tutorials we shall use it to make a few web api calls.
(Rev. 31-Oct-2024)

Categories | About |     |  

Parveen,

What is HttpRepl?

HttpRepl is basically a tool for testing web api.

It's a command-line tool - and cross platform. And, is, therefore, available wherever .NET Core is installed and available.

It can be used for testing any web api - whether written for ASPNET Core, or for, say, for the classic ASP.NET.

It can be used on localhost, on a real web hosting, and even on environments like Azure App Service.

It supports various types of http verbs such as GET, POST, DELETE, PUT, HEAD, PATCH and OPTIONS.

You can think of it as a quick, light-weight alternative to products like the Postman.

Repl stands for Read Eval Print Loop.

Video Explanation (see it happen!)

Please watch the following youtube video:

Installation of Http Repl

HttpRepl needs to be installed before you can use it. Let me explain the installation procedure.

First open visual studio, and select the menu option Tools > Command Line > Developer Command Prompt. Allow the command line console to open.

Type the command: dotnet tool install -g Microsoft.dotnet-httprepl and hit the enter key, and allow the process to complete. If everything goes fine, your installation should succeed. It can take a few seconds depending on the speed of your internet because the installation takes from a nuget package called Microsoft.dotnet-httprepl


dotnet tool install -g Microsoft.dotnet-httprepl

Now type the command httprepl -h to verify the installation of http repl. Hit enter, and you should be able to see a long list of commands supported by this tool.


httprepl -h

In the next tutorial we shall use this tool to test a few of our web apis. Thankyou!


This Blog Post/Article "(C# ASP.NET Core) Introduction to HttpRepl for Testing Web Api" by Parveen is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.