List of endpoints:
- GET /detect
- POST /detect
- GET /detect/state
- GET /detect/result
So, we have 4 methods: the first two are doing the same things - just starts detecting, the third is checking on state of detecting, the fourth outputs the result.
- Client send a document to detect forms -> GET /detect, it starts async queue (or POST, never mind).
- Client want monitor state of detecting on forms in document - ready yet? -> GET /detect/state.
- If not, server responds: "Oh, dude, this is not ready yet, I'm busy".
- If document is ready, server responds: "Yeah, done!" and returns redirect on /detect/result.
- And now, client got forms, that have been pulled out from document.