Home > Back-end >  Are REST streaming APIs implemented using HTTP Keep-Alive header packets?
Are REST streaming APIs implemented using HTTP Keep-Alive header packets?

Time:10-11

If I were to send out a HTTP GET request to e.g. the Shodan REST streaming API, is this implemented on the server side by periodically sending out HTTP Keep-Alive messages to the client in case there is no new data to be sent out? Or are there other options/techniques available for implementing REST streaming API endpoints?

CodePudding user response:

There is no such thing as an http keepalive message.

The API you link to simply doesn't tell the client in advance how long the response body is, so a client can keep reading the newline-separated messages from what counts as one response until either side decides they're done.

  • Related