- 查询域名源站GET
- 设置域名源站PUT
- 查询域名回源hostGET
- 设置域名回源hostPUT
- 查询域名HTTPSGET
- 设置域名HTTPSPUT
- 查询域名是否强制跳转HTTPSGET
- 设置域名强制跳转HTTPSPUT
- 查询域名智能压缩GET
- 设置域名智能压缩PUT
- 查询域名IPV6GET
- 设置域名IPV6PUT
- 查询域名HTTP响应头域GET
- 设置域名HTTP响应头域POST
- 查询域名IP 黑白名单GET
- 设置域名IP黑白名单POST
- 查询域名Referer黑白名单GET
- 设置域名Referer黑白名单POST
- 查询域名UA黑白名单GET
- 设置域名UA黑白名单POST
- 查询域名回源协议GET
- 设置域名回源协议PUT
- 查询域名回源HTTP请求头GET
- 设置域名回源HTTP请求头POST
- 查询域名HTTP/2GET
- 设置域名HTTP/2PUT
- 查询域名HTTP/3GET
- 设置域名HTTP/3PUT
- 查询域名最低tls版本GET
- 设置域名最低tls版本PUT
- 查询域名回源超时时间(仅限AWS渠道)GET
- 设置域名回源超时时间(仅限AWS渠道)PUT
- 查询国家/地区数据(ISO)GET
- 查询域名区域访问控制(仅限AWS渠道)GET
- 设置域名区域访问控制(仅 限AWS渠道)PUT
- 获取AWS缓存策略列表GET
- 查询域名缓存策略GET
- 设置域名缓存策略PUT
- 获取AWS回源请求头策略列表GET
- 获取AWS响应头策 略列表GET
- 获取加速域名的AWS回源请求头策略(仅限AWS渠道)GET
- 设置加速域名的AWS回源请求头策略(仅限AWS渠道)PUT
- 获取加速域名的AWS响应头策略(仅限AWS渠道)GET
- 设置加速域名的AWS响应头策略(仅限AWS渠道)PUT
设置域名HTTP响应头域
POST
/API/cdn/domain/http/response/headers
请求参数
Header 参数
Authorization
string
必需
默认值:
Bearer Af8VDldHtQxxxF4n=H8tLRl9Er7WdhaXvWWd/
Content-Type
string
json 类型
默认值:
application/json
Body 参数application/json
domain
string
加速域名名称
enable_cors
boolean
可选
cors_config
object
可选
access_control_allow_origins
object
可选
access_control_allow_headers
object
可选
access_control_allow_methods
object
可选
access_control_expose_headers
object
可选
access_control_max_age_sec
integer
可选
security_headers_config
object
安全头
strict_transport_security
object
可选
content_type_options
object
可选
frame_options
object
可选
用于控制页面是否可以被嵌入到 、<frame>、<embed> 或 <object> 元素中
xss_orotection
object
可选
referrer_policy
object
可选
content_security_policy
object
可选
custom_headers_config
array [object {2}]
可选
key
string
header头名称
value
string
header头值
remove_headers_config
array [object {1}]
可选
key
string
header头名称
示例
{
"domain": "apitest1.rgslb.link",
"enable_cors": true,
"cors_config": {
"access_control_allow_origins": {
"type": "*",
"values": []
},
"access_control_allow_headers": {
"type": "*",
"values": [
"host",
"user-agent"
]
},
"access_control_allow_methods": {
"type": "customize",
"values": [
"GET",
"POST"
]
},
"access_control_expose_headers": {
"type": "none",
"values": []
},
"access_control_max_age_sec": 604
},
"security_headers_config": {
"strict_transport_security": {
"enable": true,
"access_control_max_age_sec": 31536000,
"preload": true,
"include_subdomains": false
},
"content_type_options": {
"enable": true
},
"frame_options": {
"enable": true,
"frame_option": "SAMEORIGIN"
},
"xss_orotection": {
"enable": true,
"protection": 1,
"mode_block": true,
"report_uri": "http://www.baidu.com"
},
"referrer_policy": {
"enable": true,
"referrer_policy": "no-referrer"
},
"content_security_policy": {
"enable": true,
"content_security_policy": "default-src"
}
},
"custom_headers_config": [
{
"key": "CDN",
"value": "fusion"
},
{
"key": "test",
"value": "fusion-test"
}
],
"remove_headers_config": [
{
"key": "date"
}
]
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://ctgcdn.esurfingcloud.com/API/cdn/domain/http/response/headers' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"domain": "apitest1.rgslb.link",
"enable_cors": true,
"cors_config": {
"access_control_allow_origins": {
"type": "*",
"values": []
},
"access_control_allow_headers": {
"type": "*",
"values": [
"host",
"user-agent"
]
},
"access_control_allow_methods": {
"type": "customize",
"values": [
"GET",
"POST"
]
},
"access_control_expose_headers": {
"type": "none",
"values": []
},
"access_control_max_age_sec": 604
},
"security_headers_config": {
"strict_transport_security": {
"enable": true,
"access_control_max_age_sec": 31536000,
"preload": true,
"include_subdomains": false
},
"content_type_options": {
"enable": true
},
"frame_options": {
"enable": true,
"frame_option": "SAMEORIGIN"
},
"xss_orotection": {
"enable": true,
"protection": 1,
"mode_block": true,
"report_uri": "http://www.baidu.com"
},
"referrer_policy": {
"enable": true,
"referrer_policy": "no-referrer"
},
"content_security_policy": {
"enable": true,
"content_security_policy": "default-src"
}
},
"custom_headers_config": [
{
"key": "CDN",
"value": "fusion"
},
{
"key": "test",
"value": "fusion-test"
}
],
"remove_headers_config": [
{
"key": "date"
}
]
}'
返回响应
🟢200成功
application/json
Body
code
integer
必需
message
string
返回信息
data
array [object {3}]
必需
key
string
响应头名称
value
string | integer
响应头值
action
string
可选
domain
string
加速域名
示例
{
"code": 1,
"message": "OK",
"data": [
{
"key": "Access-Control-Allow-Origin",
"value": "*"
},
{
"key": "Access-Control-Allow-Headers",
"value": "*"
},
{
"key": "Access-Control-Allow-Methods",
"value": "GET,POST"
},
{
"key": "Access-Control-Max-Age",
"value": 604
},
{
"key": "CDN",
"value": "fusion"
},
{
"key": "test",
"value": "fusion-test"
},
{
"key": "date",
"action": "remove"
}
],
"domain": "apitest1.rgslb.link"
}
修改于 2024-08-07 02:32:18