在 uploadcare 中,我在使用 upload POST 端点时收到一个空的 403 错误

In uploadcare, I'm getting an empty 403 error when using the upload POST endpoint

我使用的是原始 post 因为我使用的是 react native 并且我没有看到 react-native 库。

我在尝试使用原始上传表单上传时收到 403 响应 post- 是否有我需要设置的设置,或者我的 public 密钥是否未激活或其他什么?我在 403 响应中没有看到文本响应,所以不确定具体错误是什么。

这是我来自 postman

的示例 CURL
curl -X POST -H "Content-Type: multipart/form-data; boundary=..." 
-F "UPLOADCARE_PUB_KEY=foo" 
-F "UPLOADCARE_STORE=1" 
-F "file=@logo.jpg" "https://upload.uploadcare.com/base/"

我看到您正在尝试使用分段上传,logo.jpg 有多大?您可以使用仪表板上传相同的文件吗?

以下是您应该注意的几件事:

    这里不需要
  1. content-type
  2. 4xx 的原因应在回复中说明 body 或 headers
  3. 确保您在 API 键中没有错别字
  4. 确保在项目中启用自动存储或发送"UPLOADCARE_STORE=auto"
  5. 确保您的帐户未被阻止、剩余一些配额、允许的文件类型等。
  6. 不要依赖 Postman,用 cURL 检查命令

这个有效:

curl -vv -X POST \ -F "UPLOADCARE_PUB_KEY=demopublickey" \ -F "UPLOADCARE_STORE=1" \ -F "file=@logo.png" "https://upload.uploadcare.com/