错误的PDF异常

2021年十一月2日
更新 2024年十月20日
分享:
This article was translated from English: Does it need improvement?
Translated
View the article in English

POST 请求中的 pdf_file 参数未被检测为 PDF 时,会出现 "ERROR-002" 错误。 确保您拥有一个有效的PDF,其type=application/pdf

推荐解决方案

提示
确保POST请求中的pdf_file参数类型为:application/pdf

在 cURL 中 pdf_file 正确语法的示例:

curl -X POST 'https://api.securedoc.com/v1/document-services/pdfs/redact-text?words_to_redact=IRON' \
  -H 'accept: */*' \
  -H 'Content-Type: multipart/form-data' \
  -F 'pdf_file=@YOUR_PDF_DOCUMENT.pdf;type=application/pdf'
CURL

请参考最后一行以正确使用:

-F 'pdf_file=@YOUR_PDF_DOCUMENT.pdf;type=application/pdf'