公共头域
更新时间:2020-09-08
公共请求头域
| 公共头域 | 描述 | 是否必选 | 
|---|---|---|
| host | 服务域名,目前固定为lss.bj.baidubce.com | 是 | 
| x-bce-date | 表示日期的字符串,符合API规范。 | 否 | 
| x-bce-request-id | 请求ID。 | 否 | 
| authorization | 包含Access Key与请求签名。 | 是 | 
| content-type | application/json; charset=utf-8。 | 是 | 
| content-length | 用于描述HTTP消息实体的传输长度the transfer-length of the message-body。 | 否 | 
下面是一个标准的用户获取特定Stream信息时的请求头域内容:
                Plain Text
                
            
            1GET /v5/domain/<playDomain>/app/<app>/stream/<stream> HTTP/1.1
2host: lss.bj.baidubce.com
3content-type: application/json
4authorization: <bce-authorization-string>LSS的API服务要求使用JSON格式(“创建文档”除外)的结构体来描述一个请求的具体内容。 下面是一个标准的用户创建通知时的请求消息体格式:
                Plain Text
                
            
            1{
2    "description": "this is a demo session",
3    "preset": "live.rtmp_hls_forward_only"
4}LSS的API服务采用JSON格式的消息体作为响应返回的格式。下面是一个标准的用户查询特定Stream时的完整的请求返回示例:
                Plain Text
                
            
            1{
2    "app": "demo_app",
3    "audit": "default",
4    "createTime": "2016-07-14T08:20:02Z",
5    "description": "",
6    "play": {
7        "flvUrl": "http://play.hello.com/test_app/test_stream.flv",
8        "rtmpUrl": "rtmp://play.hello.com/test_app/test_stream"
9    },
10    "playDomain": "demo.domain.com",
11    "preset": "live.rtmp_hls_forward_only",
12    "presets": {
13        "L0": "live.rtmp_hls_forward_only"
14    },
15    "publish": {
16        "pullUrl": "http://testpull.baidu.com",
17        "pushStream": "demo_stream",
18        "region": "bj"
19    },
20    "scene": "normal",
21    "securityPolicy": "default",
22    "sessionId": "p-ggps1qiiin8b0a3z",
23    "statistics": {
24        "bandwidthInBps": 0,
25        "playCount": 0
26    },
27    "status": "ONGOING"
28    "streamingStatus": "STREAMING"
29}