The context is a long running server side calculation. Because of this long running necessity, we can not use the default request/response, but need to handle it asynchronously.
We have 3 api endpoints available to implement this asynchronous result calculation.
- Uplaod the data to process
- Track the caculation process
- Return the calculation result
# request:
http POST /upload data=fleet-2019.xml
# response:
{
data: {
progressId: number
},
meta: {
type: 'upload'
}
}
# request:
http GET /upload-progress progressId=number
# response:
{
data: {
status: 'IN_PROGRESS'
},
meta: {
type: 'upload-progress'
}
}
# request:
http GET /upload-result progressId=number
# response:
{
data: [
# upload result data
...
],
meta: {
type: 'upload-progress'
}
}