插件介绍
Advanced Rest Client是一款非常好用且功能强大的HTTP模拟插件。
Advanced Rest Client开发背景
开发人员在实际WEB开发过程中经常会有这样的需求:例如当前开发的这个系统是需要调用其他系统的接口,需要频繁的测试接口,尝试不同的入参参数去查看返回结果,如果要在程序中调试就必要不断的改代码、重启tomcat;在调试接口时返回的json数据需要格式化后才能友好的显示,这个过程如果在程序中的话,就需要将json数据复制出来放到JsonView等软件中查,这个时候开发人员就需要一种简便的方法直接调用接口便可以查看返回的数据结构。而我们今天要介绍的这款chrome插件Advanced Rest Client就能满足这样的需求。
Advanced Rest Client简介
Advanced REST Client是Chrome浏览器下的一个插件,通过它可以发送http、https、WebSocket请求。我们网站之前也有介绍过具有相同功能的插件:
1.Rest Client:一款可以使用Chrome插件来模拟REST请求来测试REST风格的web Api的谷歌浏览器插件。
2.DHC - REST/HTTP API Client:一款使用chrome模拟REST客户端向服务器发送测试数据的谷歌浏览器插件。
3.Postman:一款功能强大的网页调试与发送网页HTTP请求的Chrome插件。
这三款插件中Rest Client的资格很老了,但是越来越多人开始倾向于使用Advanced REST Client插件。其大致功能可以概括为以下几个方面,我们下面还会讲到Advanced REST Client如何使用。
- 与Google云端硬盘集成
- 在套接字上进行的请求,使您可以更好地控制HTTP标头
- 方便的HTTP头和有效载荷编辑器
- WebSockets!
- 帮助填写HTTP头(提示+代码完成)
- 将标题列表添加为原始数据或通过表单
- 通过原始输入构建POST或PUT正文,形成或发送带请求的文件
- 设置自定义表单编码
- 记住最新的请求(保存当前表单状态并加载时恢复)
- 保存(Ctrl + S)并打开(Ctrl + O)保存的请求表单
- 请求的历史
- 数据导入/导出
Advanced Rest Client使用方法
1.如果你可以访问谷歌应用商店在线安装既可以,如果不能访问就在本站离线下载安装。
2.安装成功后,在扩展程序中查看插件,可以直接设置桌面看快捷方式。 之后就可以在桌面点击快捷方式或者在扩展程序中查看应用商店的程序并使用插件了。如下图所示:
3.Advanced REST Client的功能有很多,我们仅以最常用Rest请求为例:
我们将上图分为8个区域,每个区域的功能如下:
区域1是功能菜单,可以对请求的功能进行管理,这里主要是用Request模块模拟HttpPost请求;
区域2是Http Url输入框,用来输入请求的Url;
区域3是请求方法选择,可以选择GET、POST、PUT、DELETE等方法;
区域4一个快捷选择请求头的下拉框,主要内容在区域5,区域5里可以选择添加自定义的请求头,因为Server使用的是json的post接收方式,这里选择json的默认请求头;
区域6是POST Body,即要POST的Json内容;
点击区域7的SEND按钮发送POST请求;
区域8是POST请求的返回结果。
PUT请求和POST差不多,GET和DELETE的话没有POST Body,POST还可以模拟x-www-form-urlencoded 和 文件上传。当然还有很多其他高级功能,需要用户去深入学习使用!
Advanced Rest Client注意事项
这里要说明下,如果你在其他地方下载的Advanced-REST-client文件为crx格式,那么安装方法如下:
1、解压Advanced-REST-client_v3.1.9.zip到当前文件夹,得到Advanced-REST-client_v3.1.9目录。
2、在Chrome浏览器中打开:chrome://extensions/。
3、勾选开发者模式和选择“加载正在开发的扩展程序”。
4、选择在第一步解压出来的Advanced-REST-client_v3.1.9目录。新建标签-点击应用,或者输入:chrome://apps/
5、加载配置文件,由于没有FQ所以不会下载成功的,需要等一会,会看到选择配置文件的页面,然后关闭就OK。
这样加载的 Chrome 浏览器会在每次打开时提示 请停用以开发者模式运行的扩展程序。
THIS APPLICATION IS DEPRECATED BY GOOGLE.
Please, install desktop client from https://install.advancedrestclient.com
A better API testing tool!
Save your time with the easiest API testing tool out there. No complicated forms and scripts. Easy to use yet very powerful.
The only REST client that makes connection directly on socket giving you full control over the connection and request/response headers.
Note: You must use valid certificate (for secured connections) to use this app. Get free SSL certificate from letsencrypt.org. Alternatively check "use XHR" to disable socket and use Chrome's regular connection.
You can set up proxy in Chrome settings if you having trouble connection to the remote machine.
To run the app go to New tab page, then click "Apps" on the top bar and find the ARC icon. The app also installs itself in the system's apps search. On MacOS it's command+space, on windows it's a windows button. Type there app name to find the app.
What's new:
- Database upgrade. Now history and saved will be much faster
- Request history explorer - when you recall a history / saved request then you'll see a history of the requests you've mede to this endpoint
- New header sets - define own headers sets and use them with your requests
- Variables and variables editor - you can define your own variables and put them into the request panel
Features:
- Integrated with Google Drive
- Requests made on sockets which gives you more control over HTTP headers
- Convenient HTTP headers and payload editor
- WebSockets!
- help with filling HTTP headers (hint + code completion)
- add headers list as raw data or via form
- construct POST or PUT body via raw input, form or send file(s) with request
- set custom form encoding
- remember latest request (save current form state and restore on load)
- save (Ctrl+S) and open (Ctrl+O) saved request forms
- history of requests
- data import/export
Report issues at https://github.com/jarrodek/ChromeRestClient/issues
Privacy policy: https://docs.google.com/document/d/1BzrKQ0NxFXuDIe2zMA-0SZBNU0P46MHr4GftZmoLUQU/edit?usp=sharing
浏览器插件安装详细步骤:Chrome浏览器如何安装插件扩展