Advanced REST Client是Chrome浏览器下的一个插件,通过它可以发送http、https、WebSocket请求。在Chrome商店下搜索Advanced REST Client,即可找到
Advanced REST Client的界面
Advanced REST Client在google code的地址:http://code.google.com/p/chrome-rest-client/
下面来介绍Advanced REST Client发送请求的方法
1. 发送http请求
http://httpbin.org/有现成的get、post接口,可以直接使用
1.1 http get
在URL栏输入http://httpbin.org/get
点"Send"按钮。发送成功后,Advanced REST Client会列出Request/Response headers:
返回结果:
1.2 http post
在URL栏输入http://httpbin.org/post,选在”POST”类型,在”Payload”栏输入data,最后设置”Content-Type”
返回结果:
2. 发送https请求
使用方法跟发送http请求一样。https://httpbin.org/有现成的get、post接口,可以自己试试
3. 发送WebSocket请求
Advanced REST Client支持发送Websocket请求,通过ws://echo.websocket.org,可以进行Websocket的测试
点击左侧的”Socket”,然后在URL栏输入ws://echo.websocket.org
点击右侧的”Connect”按钮。连接成功后,即可发送消息
输入"Test",然后点"Send"按钮
第一个”Test”是Advanced REST Client发送的request,第二个”Test”是Server返回的response
点击”Disconnect”按钮,即可断开连接