Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

230
Visualizações
How to fix imgur api error status 400, 417 errors

While uploading pictures using the Imgur API, some pictures are not uploaded and returns status 400 or 417 errors.

{
  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'
  }
}

This error was fixed upon launching the console. But every time I upload a picture I have to restart the console. How may I prevent this from happening?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

The 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.

The 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.

about 4 years ago · Juan Pablo Isaza Relatório

0

Note: Your "Account" and your "Application" are distinct entities. If you try to upload to an album on your account, thinking your application has access rights to it because they are tied to the same email, you'll probably get the 417 error.

Also, it seems that imgur validates the .PNG file before validating access rights.

I have concluded that as you are trouble shooting , this is a rough gauge of "how close to succcess" you are:

1: VERY CLOSE : "Internal Expectation Failed" Your .PNG payload within the form-data is probably correct.

2: COLDER : "We Don't Support That File Type" You probably corrupted your .PNG binary file when attempting to concat it into the "form-data" payload.

3: COLDEST : "bad request" You really fucked up bad.

If you are rolling your own "multi-part form-data" like I did, one of the posters here has a good low-level example that does NOT use 3rd party libraries: NodeJS Request how to send multipart/form-data POST request

Your payload is constructed something like this:

payload=Buffer.concat([
    Buffer.from( formdata_string_top    , "utf8"   ) 
,   Buffer.from( png_binary_file        , "binary" ) 
,   Buffer.from( final_formdata_boundary, "utf8"   ) 
]);;

You might be tempted to do this , because it is readable in your logs, but it WILL_CORRUPT_YOUR_BINARY_FILE

payload=Buffer.concat([
    Buffer.from( formdata_string_top    , "utf8"   ) 
,   Buffer.from( png_binary_file        , "binary" ) 
,   Buffer.from( final_formdata_boundary, "utf8"   ) 
]).toString( "utf8" );
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda