当前位置:网站首页>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
边栏推荐
- Get the column name list of the table quickly in Oracle
- Net standard
- Website_ Collection
- MySQL modify master database
- Using quartz under. Net core - [1] quick start
- Milvus 2.0 質量保障系統詳解
- Shortcut keys (multiline)
- Devexpress GridView add select all columns
- El cascade and El select click elsewhere to make the drop-down box disappear
- Use of shell awk command
猜你喜欢
Nacos + aspnetcore + Ocelot actual combat code
[WPF binding 3] listview basic binding and data template binding
Shell script -- shell programming specification and variables
Using quartz under. Net core -- general properties and priority of triggers for [5] jobs and triggers
JS, entries(), keys(), values(), some(), object Assign() traversal array usage
2.Electron之HelloWorld
自定义my_strcpy与库strcpy【模拟实现字符串相关函数】
. net type transfer
Scope and scope chain in JS
Detailed explanation of C webpai route
随机推荐
自定义my_strcpy与库strcpy【模拟实现字符串相关函数】
Using quartz under. Net core -- a simple trigger of [7] operation and trigger
1-3 components and modules
[PROJECT] small hat takeout (8)
Signalr can actively send data from the server to the client
Detailed explanation of C webpai route
Get the column name list of the table quickly in Oracle
ClickHouse-SQL 操作
[logical fallacy in life] Scarecrow fallacy and inability to refute are not proof
C语言函数详解
New keyword learning and summary
Further study of data visualization
SPC introduction
Summary of common websites
Website_ Collection
[difference between Oracle and MySQL]
Promise (IV)
Basic case of Baidu map
ASP. Net core reads the configuration file in the class library project
RPC核心概念理解