12.5 Extras
Here are some ideas for you to add to these projects.
12.5.1 Add filtering criteria to the POST request
The POST request that initiates acquire processing is quite complicated. See A POST request starts processing to see the processing it does.
We might name the function for this route creation_job_post()
to make it clear that this creates jobs to acquire data in response to an HTTP POST request.
The list of tasks in this function includes the following:
Check the user’s permissions.
Validate the parameters.
Build an
AcquireJob
instance with the parameters.Update the
AcquireJob
instance with theFuture
object. The future will evaluate theacquire_series()
function that does the work of acquiring and cleaning the data.Return a JSON object with details of the submitted job, as well as headers and a status code to redirect to a request to get the job’s status.
Some RESTful APIs will have even more complicated parameters. For example, users may...