将base64编码数据传递到卷曲请求 - 错误:参数列表太长
我正在尝试将带有基本编码数据的参数传递给卷曲请求。它抱怨参数列表太长,因为基本编码的字符串太长。根据其他帖子的响应,我尝试将内容存储在文件中,并尝试将文件作为参数传递。在那里,我遇到了一个错误:文件已损坏或格式不支持
这是我的两个请求看起来,就像
curl -v -i POST "https://contoso.azure.com/formrecognizer/documentModels/prebuilt-idDocument:analyze?api-version=2022-06-30-preview" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: <key>" --data "{'base64Source': '<base64encoded_data>'}"
curl -v -i POST "https://contoso.azure.com/formrecognizer/documentModels/prebuilt-idDocument:analyze?api-version=2022-06-30-preview" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: <key>" --data "{'base64Source': '@file.txt'}"
我将base64编码的数据放在文件中一样 - file_screenshot
任何帮助都将不胜感激。
I am trying to pass a parameter with base encoded data to a curl request. It complains about the argument list too long because the base encoded string is too long. Based on the responses from other posts, I tried to store the content in a file and tried passing the file as a parameter. There, I am getting an error: The file is corrupted or format is unsupported
Here is what both my requests looks like
curl -v -i POST "https://contoso.azure.com/formrecognizer/documentModels/prebuilt-idDocument:analyze?api-version=2022-06-30-preview" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: <key>" --data "{'base64Source': '<base64encoded_data>'}"
curl -v -i POST "https://contoso.azure.com/formrecognizer/documentModels/prebuilt-idDocument:analyze?api-version=2022-06-30-preview" -H "Content-Type: application/json" -H "Ocp-Apim-Subscription-Key: <key>" --data "{'base64Source': '@file.txt'}"
I put the base64 encoded data in the file as is - file_screenshot
Any help is appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
curl
具有从文件中执行操作的能力。结帐以下行块。这是否回答您的问题。
CURL
has ability to performPOST
operation from a file. Checkout the following line block.Does this answer the your question.