1

I would like to send updates of a running HTTP request to the client to tell it at what stage the request-triggered process currently is.

The process behind the request does currently the following things (in this order):

Client-side:

  • Client sends an HTTP Request (upload of a file) to the server

Server-side:

  • Takes the uploaded file
  • Encrypt it
  • Upload it to an archive storage
  • Return response to the client (Meanwhile, the client does not know what currently happens)

Client-side:

  • Get response and show it to the user

I want to tell the client at what stage the process is, like “Uploading done. Encrypting…” and so on.

Is there a way to realize that, or am I missing something? Is it even possible to do?

Frameworks I'm using:

  • Client: Next.js
  • Server: Hapi.dev for API development

Thanks

julianYaman
  • 310
  • 4
  • 13
  • Does this answer your question? [How to send multiple responses while computing in Express.js?](https://stackoverflow.com/questions/65729360/how-to-send-multiple-responses-while-computing-in-express-js) – finn May 04 '22 at 10:04

1 Answers1

0

You can send non-final 1xx header responses for your http request as described here.

finn
  • 653
  • 3
  • 15