python - API Responses with large result sets -
We have a REST API in which we offer customers multiple APIs to attract analytical reports. It may take 5 to 10 minutes to complete some very big questions and can revert responses from 50 MB to 150 MB range.
At the moment, the customer expects to wait for the response. We are not sure whether this is actually the best practice or if such complex / big questions & amp; Reactions should be presented in another way.
Note: APIs will be called by automated processes to prepare large reports, so we are not certain that marking on the standard page is efficient or desirable.
If you need to process a long-running job, then the client points off , It is always better to process asynchronous process.
A customer sends a post request, the server creates a new resource (or can initiate immediate background processing) and returns the representation of HTTP 202 work (eg status, start time, expected end time and so on ) In the content-place header, the function URL can be tracked by the customer.
Customer can send a GET request to the specified URL to obtain the status. The server can return the following responses.
Not yet The server returns HTTP 200 OK returns with the work resource so that the customer can check the status. Done See server return HTTP 303 second and a place header with the URL of the resource Error Fixes server error with description work resource HTTP 200
Comments
Post a Comment