Advanced Setting
Last Updated:2020-09-17
Set HttpHeader
def test_set_domain_http_header(c):
"""
test set domain http header
"""
http_header = [
{"type": "origin", "header": "x-auth-cn", "value":"xxxxxxxxx", "action": "add"},
{"type": "response", "header": "content-type", "value":"application/octet-stream", "action": "add"}
]
domain = 'test-sdk.sys-qa.com'
response = c.set_domain_http_header(domain, http_header);
print(response)
Query HttpHeader
def test_get_domain_http_header(c):
"""
test get domain http header
"""
response = c.get_domain_http_header('test-sdk.sys-qa.com')
print(response)
Set Page Optimization
def test_set_domain_file_trim(c):
"""
test set domain file trim
"""
file_trim = True
domain = 'test-sdk.sys-qa.com'
response = c.set_domain_file_trim(domain, file_trim);
print(response)
Query Page Optimization
def test_get_domain_file_trim(c):
"""
test get domain file trim
"""
response = c.get_domain_file_trim('test-sdk.sys-qa.com')
print(response)
Set Video Drag
def test_set_domain_media_drag(c):
"""
test set domain media drag
"""
media_drag = {
"mp4":{
"fileSuffix":[
"mp4",
"m4a"
],
"startArgName":"startIndex",
"dragMode":"second"
},
"flv":{
"dragMode":"byteAV"
}
}
domain = 'test-sdk.sys-qa.com'
response = c.set_domain_media_drag(domain, media_drag);
print(response)
Query Video Drag
def test_get_domain_media_drag(c):
"""
test get domain media drag
"""
response = c.get_domain_media_drag('test-sdk.sys-qa.com')
print(response)
Set Compression Compressions
def test_set_domain_compress(c):
"""
test set domain compress
"""
compress = {"allow": True, "type": "gzip"}
domain = 'test-sdk.sys-qa.com'
response = c.set_domain_compress(domain, compress);
print(response)
Query Page Compressions
def test_get_domain_compress(c):
"""
test get domain compress
"""
response = c.get_domain_compress('test-sdk.sys-qa.com')
print(response)