HttpRepl 互操作的 RESTful HTTP 服务调试命令行工具
今天早上曽根セイラ告诉我一个好用的工具 HttpRepl 这是一个可以在命令行里面对 RESTful 的 HTTP 服务进行路由跳转和访问的命令行工具。可以使用 cd 这个命令和像文件跳转已经跳转到下一级的路由,也可以通过 dir 命令找到同一级的路由,同时支持集成到 VisualStudio 和 VisualStudio Code 里面
最近 ASP.NET 团队创建了一个叫 HttpRepl 的命令行工具,通过这个命令行工具可以像访问文件或文件夹一样访问 HTTP 服务。通过在命令行给一个入口的地址,然后就可以执行 dir 和 cd 两个命令分别用于枚举和跳转的功能
使用方法是先通过 dotnet tool install 安装这个工具,安装代码如下
dotnet tool install -g Microsoft.dotnet-httprepl --version “3.0.0-*”
安装完成之后,则可以使用如下命令指定入口
dotnet httprepl 入口URL
如官方的例子知道了访问 http://localhost:65369/ 链接
dotnet httprepl http://localhost:65369/
如果在执行以上命令的时候提示没有安装足够的 .NET Core 框架版本,那么请自行从官方 下载最新版本和最新预览版本安装
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
设置之后则可以通过 dir 查看同一级的路由里面有哪些可访问的链接
通过输入 get 命令就可以直接拉取,用起来十分简单,详细使用方法请下载安装之后输入以下命令就可以看到
dotnet httprepl http://blog.lindexi.com
help
看到的控制台输出大概如下
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
如何在 VisualStudio 集成,在每次调试的时候访问的不是浏览器而是命令行就请看 ZaraNet 大佬的博客
使用Http-Repl工具测试ASP.NET Core 2.2中的Web Api项目 - ZaraNet - 博客园
HttpRepl: A command-line tool for interacting with RESTful HTTP services
我搭建了自己的博客 https://blog.lindexi.com/ 欢迎大家访问,里面有很多新的博客。只有在我看到博客写成熟之后才会放在csdn或博客园,但是一旦发布了就不再更新
如果在博客看到有任何不懂的,欢迎交流,我搭建了 dotnet 职业技术学院 欢迎大家加入

本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议进行许可。欢迎转载、使用、重新发布,但务必保留文章署名林德熙(包含链接:http://blog.csdn.net/lindexi_gd ),不得用于商业目的,基于本文修改后的作品务必以相同的许可发布。如有任何疑问,请与我联系。
HttpRepl 互操作的 RESTful HTTP 服务调试命令行工具的更多相关文章
- 2019-8-31-HttpRepl-互操作的-RESTful-HTTP-服务调试命令行工具
title author date CreateTime categories HttpRepl 互操作的 RESTful HTTP 服务调试命令行工具 lindexi 2019-08-31 16:5 ...
- Mysql 命令行工具
1.Mysql命令行工具分为两类:服务端命令行工具和客户端命令行工具. 2.服务端工具 mysql_install_db:建库工具 mysqld_safe:Mysql服务的启动工具,mysqld_sa ...
- Expo大作战(六)--expo开发模式,expo中exp命令行工具,expo中如何查看日志log,expo中的调试方式
简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,将全部来与官网 我猜去全部机翻+个人 ...
- 春节前“摸鱼”指南——SCA命令行工具助你快速构建FaaS服务
春节将至,身在公司的你是不是已经完全丧失了工作的斗志? 但俗话说得好:"只要心中有沙,办公室也能是马尔代夫." 职场人如何才能做到最大效能地带薪"摸鱼",成为了 ...
- 玩转Windows服务系列——命令行管理Windows服务
说到Windows服务的管理就不得不说通过命令行的方式管理Windows服务,因为无论是系统管理员,还是通过编程的方式调用cmd命令,命令行都是非常方便以及强大的工具. 接下来就看一下如何通过cmd命 ...
- 玩转Windows服务系列——命令行管理Windows服务
原文:玩转Windows服务系列——命令行管理Windows服务 说到Windows服务的管理就不得不说通过命令行的方式管理Windows服务,因为无论是系统管理员,还是通过编程的方式调用cmd命令, ...
- [转]玩转Windows服务系列——命令行管理Windows服务
本文转自:http://www.cnblogs.com/hbccdf/p/managewindowsservicewithcmd.html 说到Windows服务的管理就不得不说通过命令行的方式管理W ...
- windows下启动mysql服务的命令行启动和手动启动方法
1.图形界面下启动mysql服务. 在图形界面下启动mysql服务的步骤如下: (1)打开控制面板->管理工具->服务,如下图所示: 可以看到Mysql服务目前的状态是未启动(未写已启动的 ...
- 屹今为止最好用的HTTP客户端命令行工具-接口调试神器HTTPie
一.思考❓❔ 1.你用过哪些http客户端调试工具? Postman 不够灵活 需要打开客户端, 麻烦 学习成本高 Jmeter 臃肿 麻烦 学习成本高 curl 参数多, 记不住 不够灵活 主要在L ...
随机推荐
- SFINAE and enable_if
There's an interesting issue one has to consider when mixing function overloading with templates in ...
- Effective Modern C++:03转向现代C++
07:在创建对象时注意区分()和{} 自C++11以来,指定初始化值的的方式包括使用小括号,等号,以及大括号: ); // initializer is in parentheses ; // ini ...
- Effective C++: 08定制new和delete
49:了解new-handler的行为 当operator new无法满足某一内存分配需求时,它会抛出异常(以前会返回一个null).在抛出异常之前,它会调用一个客户指定的错误处理函数,也就是所谓的n ...
- Kafka 简易教程
1.初识概念 Apache Kafka是一个分布式消息发布订阅系统. TopicKafka将消息种子(Feed)分门别类, 每一类的消息称之为话题(Topic). Producer发布消息的对象称之为 ...
- @总结 - 1@ 多项式乘法 —— FFT
目录 @0 - 参考资料@ @1 - 一些概念@ @2 - 傅里叶正变换@ @3 - 傅里叶逆变换@ @4 - 迭代实现 FFT@ @5 - 参考代码实现@ @6 - 快速数论变换 NTT@ @7 - ...
- Linux Shell 教程
Shell 教程 Shell 是一个C语言编写的程序,他是用户使用Linux的桥梁,Shell 既是一种命令语言,又是一种程序设计语言. Shell 是指一种应用程序,这个应用程序提供了一个界面用户通 ...
- auto uninstaller密钥激活码破解注册机ver 8.8.58
auto uninstaller密钥破解注册机ver 8.8.58 楼主分享几个auto uninstaller密钥破解注册机,可以用于auto uninstaller 8.8.58 .因为每个版本的 ...
- Android 使用SystemBarTint设置状态栏颜色
做项目时,发现APP的状态栏是系统默认的颜色,突然想到,为啥别的APP是自己设置的颜色(和APP本身很相搭),于是也想给自己的APP设置系统状态栏的颜色,更加美美哒... 搜了下,发现原来设置状态栏居 ...
- Top 10 open source projects of 2015
Top 10 open source projects of 2015 Posted 15 Dec 2015Jen Wike Huger (Red Hat)Feed 188 up 31 comment ...
- ]ubuntu开机自动挂载的ntfs硬盘的权限问题
原文地址:ubuntu开机自动挂载的ntfs硬盘的权限问题 在linux操作系统中, 挂载是一个非常重要的功能,使用非常频繁. 它指将一个设备(通常是存储设备)挂接到一个已存在的目录上. (这个目录可 ...