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

348
Visualizações
Compress request post body Axios

I'm creating a react-web app that must call a post REST post endpoint on Firebase Cloud functions, the only problem is that the typical request that will go through will exceed the 10mb limit:

/**
   * Create a new flyer inside the storage.
   * @param {String} adminID [Identifier of the admin issuing the request]
   * @param {Object} flyer [Flyer to upload in the storage]
   * @returns {Object} [Containing the response]
   */
  postFlyerAsync(adminID,flyer){
    return new Promise((res,rej)=>{
      const URL = endpoint + "postFlyer";
        return axios
        .post(URL,flyer, { params: { adminID: adminID } })
        .then((response) => {
          console.log(response)
          return res(response.data);
        })
        .catch((err) => {
          return rej(err);
        });
    })
  }

does it exist a way to compress the body? I've tried a million different npm packages but they are either not compatible with webpack config or too slow...any suggestions?

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

0

No amount of compression will solve your problem.

You can achieve the same security without opening up your storage by having your endpoint return a signed upload url. https://cloud.google.com/storage/docs/access-control/signed-urls

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