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

71
Visualizações
knowing whether a fetch is requesting or responding

I have a long-running fetch process that posts a large file upload and waits for it to return a different large file :

let formData = new FormData();
formData.append('file', new Blob([file.blob], {type: file.type}), file.name);
fetch(someurl, {
  method: 'POST',
  body: formData
  cache: 'no-store'
}).then(response => {
  if (!respone.ok) throw(respone.statusText);
  return response;
}).then(response => response.blob())
.then(blob => {
... do something

Can I know what part of the process the fetch is up to - Posting the Request or Recieving the Response?

https://fetch.spec.whatwg.org/#fetch-elsewhere-fetch says fetch (js) could implement a processRequestEndOfBody and processResponseEndOfBody but the js implementation (https://fetch.spec.whatwg.org/#dom-global-fetch) doesn't seem to have them. However the chrome network inspector seems to have some clue as to the state of the request/response and I'm wondering if there's a way to glean that information at runtime? Any thoughts/discussion/alternates appreciated.

about 4 years ago · Juan Pablo Isaza
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