网页加速、下载分发、动态加速、全站加速、点播分发、直播分发、上传加速、移动加速、上网加速、S-P2P、PCDN、应用性能管理、WEB应用防火墙、BotGuard爬虫管理、WSS、DMS、DDoS云清洗、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案、区块链安全加速解决方案、IPv6安全加速解决方案
修改http2.0开关配置接口。接口url的*可为域名名称或域名id。
单用户调用频率:300/5min
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 描述 |
---|---|
*domain-nameString | 需要查询配置的域名或域名id |
参数名称 | 描述 |
---|---|
*http2SettingsObject | http2.0设置,用于设置http2.0的开启或关闭,父标签 |
enableHttp2String | 开启http2.0,可选值为true和false,为空时默认为false。true表示开启http2.0;false表示关闭http2.0 |
backToOriginProtocolString | 回源协议,可选值为
http1.1:使用HTTP1.1协议版本回源,不填时默认该协议
follow-request:跟随客户端请求协议
http2.0:使用HTTP2.0协议版本回源 |
参数名称 | 描述 |
---|---|
codeString | 错误代码,当HTTPStatus不为202时出现,表示当前请求调用的错误类型 |
messageString | 响应信息,成功时为success |
错误代码(code) | 描述(message) | HTTP状态码 | 语义 |
---|---|---|---|
26938005 | The enableHttp2 must be true or false. | 400 | enableHttp2值必须为true或false |
26938005 | No http2Settings was specified. | 400 | 没有指定 http2Settings 标签 |
#!/bin/bash username="example_username" apiKey="example_apiKey" date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"` password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64` curl -i --url "https://open.chinanetcenter.com/api/config/http2/123344" \ -X "PUT" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ -d ' { "http2Settings":{ "enableHttp2":"true", "backToOriginProtocol":"http1.1" } }'
HTTP/1.1 202 Accepted Date: Sun, 05 May 2019 09:08:53 GMT Content-Type: application/json;charset=utf-8 x-cnc-request-id: 83bbebc7-2c95-47d7 {"code":"0", "message":"success", "data":""}