响应状态码

更新时间不可用

查询输入在线媒体流的响应状态码、错误码含义、常见原因和处理建议。

在调用输入在线媒体流 API 过程中,你可能收到如下 HTTP 响应状态码:

  • 如果 HTTP 状态码为 2XX,则请求成功。

  • 如果 HTTP 状态码不为 2XX,则请求失败。你可以根据对应的响应体中可能出现的 message 以及 reason 字段排查问题。

例如,请求失败时,你可能收到如下响应:

JSON
# 400 Bad Request
# 仅有 message
{
  "message": "appid is invalid"
}
JSON
# 403 Forbidden
# 仅有 reason
{
  "reason": "No invalid permission to use this function. Contact us."
}

下表列出调用输入在线媒体流 API 时,可能收到的响应状态码、message 或 reason 字段内容以及建议措施:

状态码可能的 message 或 reason 字段内容建议措施
200 OK无该字段。无需排查。
400 Bad Request
  • Parameter 'streamUrl' is invalid formatted.
  • Parameter channelName is invalid. Fix it in your request and retry.
检查报错的字段是否符合 API 文档的描述。
401 UnauthorizedInvalid authentication credentials.检查 HTTP 基本认证是否符合要求。
403 Forbidden
  • This project has not enabled Cloud Player product yet. Contact us to enable it.
  • This project's permission to use Cloud Player was revoked. Contact us for details.
检查是否已开通拉流服务。
404 Not FoundResource is not found and destroyed.使用退避重试策略。
409 ConflictResource with the same name already exists.删除已存在的同名云端播放器,然后重新请求创建。
429 Too Many Requests
  • Request rate limit exceeded.
  • Resources quota limit exceeded.
  • No available resources.
超出配额限制,等待一段时间再重试。
500 Internal Server ErrorSome internal error happened. Contact us to help fix it.使用退避重试策略。
503 Service Unavailable
  • Service overload. Retry with back off strategy, and contact us to help fix it.
  • Service unavailable temporarily. Retry with back off strategy.
使用退避重试策略。
504 Gateway TimeoutGateway timeout. Query to check whether the player has been created, or to create another one instead.使用退避重试策略。
表格内容超出当前宽度,可横向滚动查看更多列。

信息

如果以上排查方法并未解决问题,请务必在日志中打印出响应 Header 中的 X-Request-ID 和 X-Resource-ID 字段值,并请联系技术支持。

以下是一个排查问题的示例:

使用 Create 创建云端播放器时,如果响应状态码为 409 Conflict,message 为 "Resource with the same name already exists.",则代表本次请求想创建的播放器和已经创建的播放器名字(name)重复,响应 Header 中的 X-Resource-ID 字段为那个同名播放器的 ID。请检查并修改本次请求填写的播放器名字,然后重新创建播放器。