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

156
Visualizações
Is it ok to have two responses from server?

there. I using getStream chat service in React web app and i noticed one thing. After changing a channel i have two response from server one 201 and another 200.

201-xhr

and

200-Preflight

enter image description here

Sometimes i may have only one 201-xhr I was wondering could it be the issue on my app, that i make two calls or it's normal?

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

0

An HTTP request only has one response.

Your code is requesting once, but HTTP-wise, two requests are sent (giving you a total of two responses).

This happens because there's an initial request (preflight) which is done behind the scenes by the browser just to check if the CORS protocol is understood and if the server will allow your request.

You can see more details here.

Once the browser knows about the CORS options, it might decide not to request them for a while (which is why sometimes you see only 1 request/response in the network inspector).

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