区块链安全加速解决方案、IPv6安全加速解决方案、点播分发、直播分发、移动加速、网页加速、下载分发、全站加速、应用安全加速解决方案、IPv6一体化解决方案、电商安全加速解决方案、金融安全加速解决方案、政企安全加速解决方案、应用安全解决方案
通过接口自助查询压缩响应配置
Open API在线调试功能提供可视化界面在线调试API、支持生成代码示例、快速检索查看API文档等能力。前往调试
参数名称 | 类型 | 必填 | 描述 |
---|---|---|---|
domain-name | String | 否 | 需要查询配置的域名或域名id |
参数名称 | 类型 | 描述 |
---|---|---|
domain-id | String | 需要查询配置的域名id |
domain-name | String | 需要查询配置的域名 |
compression-settings | Object | 压缩响应功能配置
1.需要设置压缩响应配置时,此项必填
2.为 |
compression-enabled | String | 开启压缩响应功能:允许值为true和false |
path-pattern | String | url匹配模式,支持正则,如果是全部匹配,入参可以配置为:.* |
ignore-letter-case | String | 是否忽略大小写:允许值为true和false |
file-types | List | 配置需要压缩的文件类型,默认只对'text'文件类型压缩,配置为*时压缩任意文件类型 |
file-type-others | List | 指定文件类型开启压缩响应的另一种方式, |
#!/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/compresssetting/123344" \ -X "GET" \ -u "$username:$password" \ -H "Date: $date" \ -H "Accept: application/json" \ -H "Content-Type:application/json"
HTTP/1.1 200 OK Date: Fri, 17 May 2017 06:33:26 GMT Content-Type: application/json;charset=utf-8 x-cnc-request-id:c54cbbb4-19fe-407a-930c-3988b62ed2fs { "domain-name":"www.example.com", "domain-id":"123344", "compression-settings":{ "compression-enabled":"true", "path-pattern":"*", "ignore-letter-case":"true", "file-types":[ "image/jpeg", "application/" ] } } }