【问题标题】:YouTube Api Sending POST Request [closed]YouTube Api 发送 POST 请求 [关闭]
【发布时间】:2012-11-21 18:22:20
【问题描述】:

当我向 YouTube Api 发送 POST 请求时,它会返回类似这样的信息:

<errors xmlns='http://schemas.google.com/g/2005'><error><domain>GData</domain>>
<code>ParseException</code><internalReason>Element type "entry" must be followed 
by either         
attribute specifications, "&gt;" or "/&gt;".</internalReason></error></errors>

我不知道这是什么意思。

【问题讨论】:

  • w3.org/2005/Atom\"xmlns:yt=\"gdata.youtube.com/schemas/2007\ ">评论
  • 我尝试在视频下发表评论
  • 它可能会阻塞在 标记中的 xmlns 属性上。它属于那里吗?您是否缺少 标签?
  • 是的,至少 api 是这样说的:POST /feeds/api/videos/VIDEO_ID/ratings 主机:gdata.youtube.com 内容类型:application/atom+xml 内容长度:CONTENT_LENGTH 授权: Bearer ACCESS_TOKEN GData-Version: 2 X-GData-Key: key=DEVELOPER_KEY w3.org/2005/Atom" xmlns:gd="@987654324 @">

标签: ios http post youtube youtube-api


【解决方案1】:

如果您的评论中的内容正是您发布的内容,那么您有一个错字——第二个 xmlns 属性需要在前面的引号和属性名称之间留一个空格,以便将其识别为有效属性——这个可能是触发解析错误的原因。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-12
    • 2015-01-26
    • 2016-12-15
    • 1970-01-01
    • 1970-01-01
    • 2020-08-03
    相关资源
    最近更新 更多