【问题标题】:Form Recognizer API Analyze Layout Results in Error InvalidImageURL "Image URL is badly formatted."表单识别器 API 分析布局导致错误 InvalidImageURL“图像 URL 格式错误”。
【发布时间】:2020-04-18 20:08:05
【问题描述】:

试过 pdf 和 png 都有相同的错误。已验证可以在浏览器中查看源文件ie。匿名访问。尝试从 API 浏览器调用方法https://westus2.dev.cognitive.microsoft.com/docs/services/form-recognizer-api-v2-preview/operations/AnalyzeLayoutAsync/console

【问题讨论】:

  • 有完全相同的问题..

标签: azure-cognitive-services


【解决方案1】:

此“InvalidImageURL”错误代码可能具有误导性。这可能意味着图像不可访问。调用 API 的另一种选择是使用二进制数据,它使用 Content-Type:application/pdfimage/jpegimage/png、或 image/tiff,而不是使用 Content-Type: application/json,后者使用图像 URL。

如果有助于澄清,请参阅我的帖子 here

集成电路

【讨论】:

    【解决方案2】:

    我遇到了同样的问题,并且能够通过序列化正文有效负载中的对象来解决它。在python中...

    body = { "source": "https://...." }  
    resp = post(url = post_url, data = json.dumps(body), headers = headers, params = params)
    

    【讨论】:

      猜你喜欢
      • 2022-01-02
      • 2020-09-26
      • 1970-01-01
      • 1970-01-01
      • 2016-12-16
      • 1970-01-01
      • 1970-01-01
      • 2015-09-08
      • 2020-11-07
      相关资源
      最近更新 更多