I need help creating a RESTful design for an application with a progress bar.
Imagine an application where one of the resources takes a long time (1+ minutes) to respond to HTTP GET (in my case, I'm scanning the network for devices). I'd like clients to display a progress bar indicating how long the GET operation will take but in order for this to work the server needs to provide them with a time estimate for the operation.
Given a slow operation:
HTTP GET /devices
What's a RESTful way of providing a time estimate for it? I don't think I can use:
HTTP HEAD /devices
because HEAD
is supposed to return the same values as GET
minus the body which (I think) means I'll have to run the very same long operation I'm trying to avoid. Any ideas?