今天早上曽根セイラ告诉我一个好用的工具 HttpRepl 这是一个可以在命令行里面对 RESTful 的 HTTP 服务进行路由跳转和访问的命令行工具。可以使用 cd 这个命令和像文件跳转已经跳转到下一级的路由,也可以通过 dir 命令找到同一级的路由,同时支持集成到 VisualStudio 和 VisualStudio Code 里面



最近 ASP.NET 团队创建了一个叫 HttpRepl 的命令行工具,通过这个命令行工具可以像访问文件或文件夹一样访问 HTTP 服务。通过在命令行给一个入口的地址,然后就可以执行 dircd 两个命令分别用于枚举和跳转的功能

使用方法是先通过 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 服务调试命令行工具的更多相关文章

  1. 2019-8-31-HttpRepl-互操作的-RESTful-HTTP-服务调试命令行工具

    title author date CreateTime categories HttpRepl 互操作的 RESTful HTTP 服务调试命令行工具 lindexi 2019-08-31 16:5 ...

  2. Mysql 命令行工具

    1.Mysql命令行工具分为两类:服务端命令行工具和客户端命令行工具. 2.服务端工具 mysql_install_db:建库工具 mysqld_safe:Mysql服务的启动工具,mysqld_sa ...

  3. Expo大作战(六)--expo开发模式,expo中exp命令行工具,expo中如何查看日志log,expo中的调试方式

    简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,将全部来与官网 我猜去全部机翻+个人 ...

  4. 春节前“摸鱼”指南——SCA命令行工具助你快速构建FaaS服务

    春节将至,身在公司的你是不是已经完全丧失了工作的斗志? 但俗话说得好:"只要心中有沙,办公室也能是马尔代夫." 职场人如何才能做到最大效能地带薪"摸鱼",成为了 ...

  5. 玩转Windows服务系列——命令行管理Windows服务

    说到Windows服务的管理就不得不说通过命令行的方式管理Windows服务,因为无论是系统管理员,还是通过编程的方式调用cmd命令,命令行都是非常方便以及强大的工具. 接下来就看一下如何通过cmd命 ...

  6. 玩转Windows服务系列——命令行管理Windows服务

    原文:玩转Windows服务系列——命令行管理Windows服务 说到Windows服务的管理就不得不说通过命令行的方式管理Windows服务,因为无论是系统管理员,还是通过编程的方式调用cmd命令, ...

  7. [转]玩转Windows服务系列——命令行管理Windows服务

    本文转自:http://www.cnblogs.com/hbccdf/p/managewindowsservicewithcmd.html 说到Windows服务的管理就不得不说通过命令行的方式管理W ...

  8. windows下启动mysql服务的命令行启动和手动启动方法

    1.图形界面下启动mysql服务. 在图形界面下启动mysql服务的步骤如下: (1)打开控制面板->管理工具->服务,如下图所示: 可以看到Mysql服务目前的状态是未启动(未写已启动的 ...

  9. 屹今为止最好用的HTTP客户端命令行工具-接口调试神器HTTPie

    一.思考❓❔ 1.你用过哪些http客户端调试工具? Postman 不够灵活 需要打开客户端, 麻烦 学习成本高 Jmeter 臃肿 麻烦 学习成本高 curl 参数多, 记不住 不够灵活 主要在L ...

随机推荐

  1. SFINAE and enable_if

    There's an interesting issue one has to consider when mixing function overloading with templates in ...

  2. php 获取客户端的ip、地理信息、浏览器信息、本地真实ip

    转自:http://www.blhere.com/948.html 这是非常实用的php常用类.获取客户端的ip.地理信息.浏览器信息.本地真实ip 1234567891011121314151617 ...

  3. 使用iPhone为Apple Watch制作动画

    (原文:Make Animations for APPLE WATCH Using iPhone 作者:Andy Drizen 译者:xiaoying) 无论要做一个像hamburger button ...

  4. 亚洲唯一,阿里云SLB位列Gartner全球网络负载均衡市场前五

    近日,Gartner发布了最新的全球企业级网络设备市场份额报告“Market Share: Enterprise Network Equipment by Market Segment, Worldw ...

  5. jenkins集成错误 标签: 发布 2016-01-10 20:45 747人阅读 评论(21) 收藏

    进入ITOO的项目以后,终于要将自己负责的模块在jenkins上面集成发布了.首先自己按照文档要求一步一步的将配置完成,然后构建,不错所料出错了,经过修改,终于构建成功!构建成功以后就没再管了,结果第 ...

  6. @atcoder - ARC066F@ Contest with Drinks Hard

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 给定序列 T1, T2, ... TN,你可以从中选择一些 Ti ...

  7. python基础之逻辑题(3)

    Python基础之逻辑题(3) 1.编写一个函数实现将IP地址转换成一个整数 2.求结果:---lambda 3.求a的结果 4.求下面nums的输出 5.求下面片段的输出 6.写出程序的结果:--- ...

  8. QQ 第三方登录

  9. js毫秒数转天时分秒

    formatDuring: function(mss) {   var days = parseInt(mss / (1000 * 60 * 60 * 24));   var hours = pars ...

  10. Java 简单校验框架

    数据校验框架现状 在我们的方法入口后面,难免会有如下样子的代码: result.setSuccess(false); if (StringUtils.isBlank(bizOrder.getThird ...