折旧
这一构成部分已贬值。 使用 @advanced-rest-client/app 换句话说.
一个模块,在HTTP请求和请求编辑器中包含处理HTTP头的UI和逻辑.
使用量
安装
npm install --save @advanced-rest-client/arc-headers
页眉
作为字符串、阵列、对象或标题对象处理标题的帮助者类.
import { HeadersParser } from '@advanced-rest-client/arc-headers';
const errorMessage = HeadersParser.getError('Whitespace Name: x-true');
标题编辑器
HTTP 头编辑器 UI.
<headers-editor id="editor"></headers-editor>
<script>
{
editor.model = [{ name: 'content-type', value: 'application/json', enabled: true }];
// or
editor.value = 'content-type: application/json';
editor.onchange = (e) => { console.log(e.target.value, e.target.model); }
}
</script>
尽量不要同时使用 value 财务报告和审定财务报表 model 当设置编辑器的值时。 最后一组值胜出并超越另一组值.
如果应用程序使用头部视图模式(用于添加对启用/失效头状态的支持),那么只使用模型. 编辑会的
当设置模型更改后发生任何变化时生成值。 这样做是为了尽量减少与编辑器合作时的计算次数.
组件收听内容类型更改事件(定义于 弧形活动 as requestEvents.state.contentTypeChange),并在处理事件时更新了当前值.
标题列表元素
已格式化的 HTTP 头列表 .
<headers-list id="list"></headers-list>
<script>
{
editor.headers = 'content-type: x-test\nLink: <https://api.github.com/organizations/19393150/repos?page=6>, rel="next";';
}
</script>
发展
git clone https://github.com/advanced-rest-client/arc-headers
cd arc-headers
npm install
本地运行演示
npm start
运行测试
npm test