我正在尝试使用 Windows Azure 媒体服务使用他们的 REST API 上传视频。
到目前为止我所做的是我已经成功获得了一个 access_token。按照他们网站上的指南,我现在需要创建一个资产。这部分的教程告诉我,我需要触发这样的请求:
POST https://media.windows.net/API/Assets HTTP/1.1
Content-Type: application/json;odata=verbose
Accept: application/json;odata=verbose
DataServiceVersion: 3.0
MaxDataServiceVersion: 3.0
x-ms-version: 2.1
Authorization: Bearer my-access-token
Host: media.windows.net
Content-Length: 27
Expect: 100-continue
{ "Name" : "NewJSONAsset" }
但我的回答与指南中提供的不同。它看起来像这样:
{
"odata.metadata": "https://wamshknclus001rest-hs.cloudapp.net/api/$metadata",
"value": [
{
"name": "AccessPolicies",
"url": "AccessPolicies"
},
{
"name": "Locators",
"url": "Locators"
},
{
"name": "ContentKeys",
"url": "ContentKeys"
},
{
"name": "Files",
"url": "Files"
},
{
"name": "Assets",
"url": "Assets"
},
{
"name": "IngestManifestFiles",
"url": "IngestManifestFiles"
},
{
"name": "IngestManifestAssets",
"url": "IngestManifestAssets"
},
{
"name": "IngestManifests",
"url": "IngestManifests"
},
{
"name": "StorageAccounts",
"url": "StorageAccounts"
},
{
"name": "Tasks",
"url": "Tasks"
},
{
"name": "NotificationEndPoints",
"url": "NotificationEndPoints"
},
{
"name": "Jobs",
"url": "Jobs"
},
{
"name": "TaskTemplates",
"url": "TaskTemplates"
},
{
"name": "JobTemplates",
"url": "JobTemplates"
},
{
"name": "MediaProcessors",
"url": "MediaProcessors"
},
{
"name": "Operations",
"url": "Operations"
},
{
"name": "Origins",
"url": "Origins"
}
]
}
更重要的是 - 我对所有其他 api 端点(等)都得到了完全相同的GET /assets
响应GET /jobs
。
我确信这是一个很容易解决的问题,我在这里遗漏了一些东西。