如何修复 imgur api 错误状态 400、417 错误

How to fix imgur api error status 400, 417 errors

在使用 Imgur API 上传图片时, 有些图片没有上传和 returns 状态 400 或 417 错误。

{
  status: 400,
  success: false,
  data: {
    error: "We don't support that file type!",
    request: '/3/upload'
}
{
  status: 417,
  success: false,
  data: {
    error: 'Internal expectation failed',
    request: '/3/upload',
    method: 'POST'
  }
}

此错误已在启动控制台时修复。 但是每次我上传图片我都必须重新启动控制台。我怎样才能防止这种情况发生?

417 error states that the Imgur CDN was expecting a file type such as .png, .mp4, .gif, etc. You may view the supported file types here.

400 indicates an improper / bad request , while requesting the API for a POST type request you must know how to properly request it, you may refer to the proper method here.