Ask HN: RFC for progress info in API calls? (tired of spinners)
So here's a tentative proposal: add an HTTP header like "X-Wants-Progress: 1" to the request indicating that the client wants progress information.
A compliant server then includes a "X-Has-Progress: 1" header in its response and streams newline delimited numbers-as-strings in the [0.0-100.0] range as progress is made.
Floats allowed, monotonically increasing, same number can be repeated, clients should protect themselves by updating with max(old_value, new_value).
Once the progress part has completed, an empty newline is inserted and the real HTTP result is appended, status code, headers, body and all.
This way clients and servers can opt-in to being "progress capable", and if you ensure you have that capability all the way through then you can switch from the dreaded spinner-of-death to a smooth progress bar.
Thoughts?