I will not find in the documentation and in the search for such a scenario. The client sends one or more commands in one request, and the server responds as it executes with several messages.
Multipart / * types are suitable for this. The server will write messages with a multipart separated by boundary. The client will display data as it is received. It would be desirable for each part of the response to be executed Kalbak.
I know web sockets, but no.
For example , Google has such an api
Interaction example (in Google, the example is slightly different, but the response is similar)
I send a POST request to my server. The answer is:
HTTP/1.1 200 OK Content-Type: multipart/mixed; boundary=batch_pK7JBAk73-E=_AA5eFwv4m2Q= --batch_pK7JBAk73-E=_AA5eFwv4m2Q= Content-Type: application/http Content-ID: <response-1> HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 { "id":1, "data": "data1" } --batch_pK7JBAk73-E=_AA5eFwv4m2Q= Content-Type: application/http Content-ID: <response-2> HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 { id: 2, data: "data2" } --batch_pK7JBAk73-E=_AA5eFwv4m2Q= and so much response in 15-30 minutes. Another encapsulation is possible.
It would be desirable that on each answer inside big callback in javascript was executed. Like .then(successCallback, errorCallback) . Only then will be executed when the HTTP request ends.
Working with HTTP attachments or with simple attachments like mjpeg streams is interesting.
EventSource is interesting, but it will reconnect at the end of the stream. I need a request-response.
responsethey call the data between the separators (boundary). There may be many. The server response at the docks is calledHTTP responseand it is only one. TheHTTP responsecontains severalresponseie data. - Igor Golovin