当前位置:网站首页>Header built-in object
Header built-in object
2022-04-23 17:15:00 【MiMenge】
effect
in the light of Request header perhaps Response head Do something
establish
Constructor creation
let headers = new Header();
During the creation process, you can add initialized header data to it
let header = new Header({
'Content-Type' : 'application/json',
----------------------------------
"Content-Type' : 'text/html',
·········
});
Apis
| Method | describe |
|---|---|
| append() | towards header Object key,value data Such as header.append('Content-Type'. 'image/jpg'); |
| delete() ! Use with caution | Delete the specified header |
| entries | Iterate header information using iterators |
| has() | Check whether the header contains a key, Returns a Boolean value |
| get() | Get the specified header information |
| set() | Create header information key value |
| keys() | Traversal header information key |
| values() | Traversal header information value |
Use
combination fetch Use
let header = new Headers({
'Content-Type': 'application/json'
});
fetch('http://xxx/xxx/xx', {
method: 'post',
header,
body: JSON.stringify({
uname: 'Tom', age: 123});
}).then(data => data.text())
.then(value => console.log(value)).catch(err => console.error(err));
版权声明
本文为[MiMenge]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230553027546.html
边栏推荐
- Multithreaded @ async thread pool
- Some problems encountered in recent programming 2021 / 9 / 8
- ClickHouse-SQL 操作
- XTask与Kotlin Coroutine的使用对比
- Promise (II)
- 文件操作《二》(5000字总结篇)
- JS, entries(), keys(), values(), some(), object Assign() traversal array usage
- 快时钟同步慢时钟域下的异步控制信号slow clk to fast clk
- Lock锁
- Shortcut keys (multiline)
猜你喜欢

Milvus 2.0 détails du système d'assurance de la qualité

RPC核心概念理解

快时钟同步慢时钟域下的异步控制信号slow clk to fast clk

ASP. Net core dependency injection service life cycle

C# Task. Delay and thread The difference between sleep

Shell script -- shell programming specification and variables

Bottom processing of stack memory in browser

Shell脚本——Shell编程规范及变量

Net standard

Deep understanding of control inversion and dependency injection
随机推荐
C# Task. Delay and thread The difference between sleep
[simple understanding of database]
ASP. NET CORE3. 1. Solution to login failure after identity registers users
Production environment——
Further optimize Baidu map data visualization
[WPF binding 3] listview basic binding and data template binding
Webapi + form form upload file
Clickhouse - data type
ASP. Net core dependency injection service life cycle
RPC核心概念理解
Self use learning notes - connectingstring configuration
Generation of barcode and QR code
Some problems encountered in recent programming 2021 / 9 / 8
New keyword learning and summary
Using quartz under. Net core -- job attributes and exceptions of [4] jobs and triggers
Multithreaded @ async thread pool
Milvus 2.0 质量保障系统详解
Collect blog posts
[markdown notes]
[PROJECT] small hat takeout (8)