知识卡片
明确HTTP请求参数职责
请求可用WITH-METHOD选择方法、WITH-QUERY <JSON对象>设查询参数、WITH-BODY <name=value&…>设请求体,并以WITH-ENCODING指定体编码。WITH-ACCEPT表达期望的响应类型,WITH-HEADERS补充请求头,两者与请求体编码职责不同。按书中表格,方法缺省GET、体编码缺省表单编码;这是历史工具语法,未实测当前包。
这张卡片看不懂?
这张卡片的反馈已满 10 条,暂时无法继续提交。
已有反馈 · 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