RESTful HTTP service debugging command line tool for HttpRepl interoperability

Keywords: shell JSON

This morning, Chogen told me a useful tool, HttpRepl, which is a command line tool that can route and access RESTful HTTP services from the command line.You can use the cd command with routes that jump to the next level, like file jumps, or dir commands to find routes at the same level, while supporting integration into VisualStudio and VisualStudio Code

Recently, the ASP.NET team created a team called HttpRepl Command-line tool that allows you to access HTTP services like a file or folder.By giving the address of an entry on the command line, you can then execute the dir and cd commands for enumeration and jump, respectively

Use this by installing the tool through dotnet tool install with the following code

dotnet tool install -g Microsoft.dotnet-httprepl --version "3.0.0-*"

After the installation is complete, you can specify the entry using the following command

dotnet httprepl entry URL

Visit http://localhost:65369/link as an official example

dotnet httprepl http://localhost:65369/

If you are prompted to not install enough versions of the.NET Core framework when executing the above command, proceed from Official Download the latest version and the latest preview version installation

It was not possible to find any compatible framework version
The specified framework 'Microsoft.NETCore.App', version '3.0.0-preview6-27804-01' was not found

Once set, you can dir to see which links are accessible within the same level of routing

You can pull it directly by typing the get command, which is very simple to use. You can see how to use it by typing the following command after downloading and installing

dotnet httprepl http://blog.lindexi.com
help

The console output you see is roughly as follows

C:\Users\lindexi>dotnet httprepl http://blog.lindexi.com
(Disconnected)~ set base "http://blog.lindexi.com"

http://blog.lindexi.com/~ help

HTTP Commands:
Use these commands to execute requests against your application.

GET            get - Issues a GET request
POST           post - Issues a POST request
PUT            put - Issues a PUT request
DELETE         delete - Issues a DELETE request
PATCH          patch - Issues a PATCH request
HEAD           head - Issues a HEAD request
OPTIONS        options - Issues a OPTIONS request

set header     Sets or clears a header for all requests. e.g. `set header content-type application/json`

Navigation Commands:
The REPL allows you to navigate your URL space and focus on specific APIs that you are working on.

set base       Set the base URI. e.g. `set base http://locahost:5000`
set swagger    Sets the swagger document to use for information about the current server
ls             Show all endpoints for the current path
cd             Append the given directory to the currently selected path, or move up a path when using `cd ..`

Shell Commands:
Use these commands to interact with the REPL shell.

clear          Removes all text from the shell
echo [on/off]  Turns request echoing on or off, show the request that was made when using request commands
exit           Exit the shell

REPL Customization Commands:
Use these commands to customize the REPL behavior.

pref [get/set] Allows viewing or changing preferences, e.g. 'pref set editor.command.default 'C:\\Program Files\\Microsoft VS Code\\Code.exe'`
run            Runs the script at the given path. A script is a set of commands that can be typed with one command per line
ui             Displays the Swagger UI page, if available, in the default browser

How to integrate VisualStudio, check out the ZaraNet blog every time you debug, not the browser but the command line

Testing the Web Api project - ZaraNet - Blog Park in ASP.NET Core 2.2 using the Http-Repl tool

HttpRepl: A command-line tool for interacting with RESTful HTTP services

I set up my own blog https://blog.lindexi.com/ Welcome, there are many new blogs.I don't put my blog on csdn or blog park until I see it's mature, but once it's published, it won't be updated

If you see anything you don't understand in the blog, welcome to communicate, I set up dotnet Vocational and Technical College Welcome to join us


This work uses Knowledge Sharing Attribution-Non-Commercial Use-Sharing 4.0 International License Agreement in the Same Way License.Reprint, use and republish are welcome, but the article signature must be retained Lindexi (Contains links: http://blog.csdn.net/lindexi_gd) and must not be used for commercial purposes. Works modified in this article must be published under the same license.If you have any questions, please contact me contact.

Posted by VladSun on Sun, 22 Sep 2019 18:19:48 -0700