知识卡片

操作参考卡 · 5172

明确HTTP请求参数职责

理解等级:中级

请求可用WITH-METHOD选择方法、WITH-QUERY <JSON对象>设查询参数、WITH-BODY <name=value&…>设请求体,并以WITH-ENCODING指定体编码。WITH-ACCEPT表达期望的响应类型,WITH-HEADERS补充请求头,两者与请求体编码职责不同。按书中表格,方法缺省GET、体编码缺省表单编码;这是历史工具语法,未实测当前包。

这张卡片看不懂?

已有反馈 · 0 / 10 条

    还没有人提交反馈。

    在整书笔记中的位置

    原书出处 · 1 处

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

      .. WITH-ACCEPT <stringǀ$#> Sets the accept header directly .. WITH-HEADERS <{ n:v,… }ǀ$#> Requests headers .. WITH-OAUTH <stringǀ$#> Sets the authorization header using the named OAUTH token .. WITH-BASIC <stringǀ$#> Sets the authorization header using the named BASIC config .. WITH-QUERY <{ n:v,… }ǀǀ$#> Query string args as JSON nvps .. WITH-BODY <name=value&…ǀ$#> For POST/PUT/PATCH (defaults to app/form-urlencoded) .. WITH-METHOD <string}ǀ$#> To set HTTP method (defaults to GET) .. WITH-ENCODING <media-typeǀ$#> To set custom encoding for POST/PUT/PATCH .. WITH-FORMAT Sets accept header with config value .. WITH-PROFILE Sets link profile header with config value

    参考来源

    - 位置:《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) - 结论依据:原文直接给出相应职责、操作或比较;本卡保留其用途与适用边界,不将历史接口表述当作当前工具验证。 - 原始内容:.. WITH-ACCEPT <stringǀ$#> Sets the accept header directly .. WITH-HEADERS <{ n:v,… }ǀ$#> Requests headers .. WITH-OAUTH <stringǀ$#> Sets the authorization header using the named OAUTH token .. WITH-BASIC <stringǀ$#> Sets the authorization header using the named BASIC config .. WITH-QUERY <{ n:v,… }ǀǀ$#> Query string args as JSON nvps .. WITH-BODY <name=value&…ǀ$#> For POST/PUT/PATCH (defaults to app/form-urlencoded) .. WITH-METHOD <string}ǀ$#> To set HTTP method (defaults to GET) .. WITH-ENCODING <media-typeǀ$#> To set custom encoding for POST/PUT/PATCH .. WITH-FORMAT Sets accept header with config value .. WITH-PROFILE Sets link profile header with config value