我无法使用API​​在Microsoft实时流媒体中创建频道

时间:2019-02-07 09:03:08

标签: c# json azure api live-streaming

如何通过api创建频道?

使用邮递员测试api:

//header


 POST api/Channels HTTP/1.1:
    DataServiceVersion: 3.0;NetFx  
    MaxDataServiceVersion: 3.0;NetFx  
    Accept: application/json;odata=minimalmetadata  
    Accept-Charset: UTF-8  
    x-ms-version: 2.11  
    Content-Type: application/json;odata=minimalmetadata  
    Host: https://<mydomin>.restv2.northeurope.media.azure.net/api/  
    User-Agent: Microsoft ADO.NET Data Services  
    Authorization: Bearer "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ii1zeE1KTUxDSURXTVRQdlp5SjZ0eC1DRHh3MCIsImtpZCI6Ii1zeE1KTUxDS"

//body


  {  
    "Id":5,  
    "Name":"testchannel001",  
    "Description":"",  
    "Created":"0001-01-01T00:00:00",  
    "LastModified":"0001-01-01T00:00:00",  
    "State":Stopping,  
    "Input":  
       {  
       "KeyFrameInterval":null,  
       "StreamingProtocol":"FragmentedMP4",  
       "AccessControl":  
          {  
             "IP":  
             {  
                "Allow":[{"Name":"testName1","Address":"<myip>","SubnetPrefixLength":24}]  
             }  
          },  
       "Endpoints":[]  
       },  
    "Preview":  
       {  
       "AccessControl":  
          {  
             "IP":  
             {  
                "Allow":[{"Name":"testName2","Address":"<myip>","SubnetPrefixLength":24}]  
             }  
          },  
          "Endpoints":[]  
       },  
    "Output":  
       {  
       "Hls":  
          {  
             "FragmentsPerSegment":1  
          }  
       },  
    "CrossSiteAccessPolicies":  
       {  
          "ClientAccessPolicy":null,  
          "CrossDomainPolicy":null  
       }  
    }  

无法获得任何响应,并且连接到https://.restv2.northeurope.media.azure.net/api/Channels时出错。

这是编码错误还是网络错误?

0 个答案:

没有答案