Getting started with HTTP REPL in ASP.NET Core

|  Posted: November 8, 2018  |  Categories: General

On September 2018, .NET Core 2.2 preview 2 has been released. ASP.NET Core team keeping the Web API improvements as a major theme for this release.

Currently, there is no tool built into the visual studio to test Web API. You will be using a browser to test GET API calls, or third-party tools like Postman, or Fiddler to test complete Web API.

The ASP.NET Core team is building command line tool REPL for making HTTP calls and viewing their results.

HTTP-REPL is currently being developed and the preview version can be installed using the following command.

dotnet tool install -g dotnet-httprepl –version 2.2.0-* –add-source

.Net Core team planning to release it as a global tool in the release of .NET CORE 2.2. HTTP-REPL uses the Swagger/Open API spec and lists down the all the routes and HTTP verbs.

Once installed, you can verify the installation using the following command

REPL global

You can run http-repl using the command

dotnet httprepl

You can point to any API which has swagger enabled to try out HTTP-REPL by setting the base URL.

Set base “<<API_URL>>”


When you are setting base URL for REPL, it gathers the HTTP verbs information from its related swagger JSON file.



Traversing to various directories, listing the existing verbs within API becomes easy with help of various commands

set base     –      Set the base URI. e.g. `set base http://locahost:5000`

ls     –      Show all endpoints for the current path.

set swagger  –      Set the URI, relative to your base if set, of the Swagger document for this API. e.g. `set swagger /swagger/v1/swagger.json`

cd     –      Append the given directory to the currently selected path, or move up a path when using `cd ..`.


Making API calls

The following diagram shows the example of making a GET call to API

API calls

For making a POST, you have options to set header such as Content-Type from the command prompt. HTTP REPL provides an auto-complete option as well when you start typing the command

 /api/Events~ set header Content-Type application/json


While making POST call, you have the option to set default editor to pass the content body to API

pref set editor.command.default ‘d:\notepad.exe’

Once the default editor has been set, the editor gets open with the default template of API structure while attempting to make a POST call

default editor

You can fill out the information and save the file to continue the API call.


Pros and Cons


  • Helps to test WEB API
  • Fast and quickly switch between API endpoints
  • Descriptive error response has shown


  • Dependency on Swagger/Open API specification
  • Not as informative as UI tools



This tool will be helpful for people who are fans of terminals. Its good initiative that the dotnet team is shipping an API testing tool as part of .NET Core 2.2 release.

Author: Pandiyan Murugan

A techie!!

Get notified about any future events

Interested in learning more about TechMeet360 or knowing about any future events? Sign up below to get notified.

Back to Top