设置移动访问控制
更新时间:2020-10-13
百度智能云CDN通过对请求中User-Agent的判断,使得CDN用户可以通过开启移动访问开关来有针对性及差异性的管理移动端/PC端的资源内容分发,本接口用于开启或关闭此功能。
Method | Path | 说明 |
---|---|---|
PUT | /v2/domain/{domain}/config?mobileAccess | 开启或关闭有针对性地对源端(移动端或PC端等)请求的资源内容分发 |
domain:CDN加速域名
请求体(Request Body)
参数 | 可选 | 类型 | 说明 |
---|---|---|---|
mobileAccess | 必选 | MobileAccess | 移动访问控制 |
MobileAccess:
参数 | 可选 | 类型 | 说明 |
---|---|---|---|
distinguishClient | 必选 | bool | true表示有针对性地对源端(移动端或PC端等)请求的资源内容分发,false表示无特殊针对 |
响应码 (Http Status Code)
HTTP Status Code | 说明 |
---|---|
200 | 成功 |
400 | 更新失败,参数错误等 |
请求示例
Plain Text
1PUT /v2/domain/myself.baidu.com/config?mobileAccess HTTP/1.1
2Host: cdn.baidubce.com
3Content-Length: 44
4Content-Type: application/json
5
6{
7 "mobileAccess":{
8 "distinguishClient":true
9 }
10}
响应示例
Plain Text
1HTTP/1.1 200 OK
2Content-Type: application/json; charset=utf-8
3Transfer-Encoding: chunked
4
5{
6 "status":"RUNNING"
7}