知识卡片

操作参考卡 · 5159

启动或批量运行超媒体脚本

理解等级:中级

HyperCLI是一个面向HTTP与超媒体表示的REPL。书中安装命令为npm install -g @mamund/hyper,以hyper进入交互,再执行GOTO <url>。已写好的HyperLANG文件可用hyper <脚本文件输入,适合复用一串交互。示例Heroku地址属于2022年环境,本卡未安装或访问该服务,也不保证现在仍在线。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

    • 附录D:HyperCLI操作参考 · 查看原书依据

      Here’s a super simple HyperLANG script: GOTO https://company-atk.herokuapp.com And here’s how you do it: Make sure you have installed the latest update of the HyperCLI: $> npm install -g @mamund/hyper Launch the HyperCLI REPL: $> hyper Type the following command and press Enter: > GOTO https://company-atk.herokuapp.com It may take a few seconds for the sample service to fire up, but eventually you should see the following response: STATUS 200 https://company-atk.herokuapp.com application/forms+json; charset=utf-8 You can also view the request/response details with these commands: SHOW REQUEST SHOW RESPONSE SHOW METADATA SHOW ALL SHOW URL SHOW STATUS SHOW CONTENT-TYPE SHOW HEADERS Finally, you can place all the HyperLANG commands in a text file and then pipe that file into the HyperCLI, like this: $> hyper <hello-hyper.script Congratulations! You’ve just created your first HyperLANG program.

    参考来源

    - 位置:《RESTful Web API Patterns and Practices Cookbook》Appendix D. Using the HyperCLI(来源项目book-sources,源文件:extracted/RESTful Web API Patterns and Practices Cookbook Connecting and Orchestrating Microservices and Distributed Data (Mike Amundsen)/_epub-src/OEBPS/app04.xhtml) - 结论依据:原文直接给出相应职责、操作或比较;本卡保留其用途与适用边界,不将历史接口表述当作当前工具验证。 - 原始内容:Here’s a super simple HyperLANG script: GOTO https://company-atk.herokuapp.com And here’s how you do it: Make sure you have installed the latest update of the HyperCLI: $> npm install -g @mamund/hyper Launch the HyperCLI REPL: $> hyper Type the following command and press Enter: > GOTO https://company-atk.herokuapp.com It may take a few seconds for the sample service to fire up, but eventually you should see the following response: STATUS 200 https://company-atk.herokuapp.com application/forms+json; charset=utf-8 You can also view the request/response details with these commands: SHOW REQUEST SHOW RESPONSE SHOW METADATA SHOW ALL SHOW URL SHOW STATUS SHOW CONTENT-TYPE SHOW HEADERS Finally, you can place all the HyperLANG commands in a text file and then pipe that file into the HyperCLI, like this: $> hyper <hello-hyper.script Congratulations! You’ve just created your first HyperLANG program.