Overview
This article explains how to track the progress of asynchronous tasks created by the JetPatch API server when performing actions on endpoints. It covers querying task status and using conditional requests with ETags.
Task Creation
Upon API requests that require actions on endpoints, the JetPatch server responds with 202 Accepted and creates a relevant asynchronous task. The response includes the task's ETag and the task object, to enable the client to subsequently query task status.
Querying Task Status
To query task status, the client should perform a GET request on the task.
Optionally, the request can include an If-None-Match header to make the action conditional on the task having changed.
Request Syntax
Request syntax (with If-None-Match option):
|
GET <task-url> If-None-Match: "<ETag>" |
where <ETag> is the ETag returned when the task was created.
Response Handling
If the If-None-Match condition is not met (the task hasn't changed), the response code is 304: Not Modified. Otherwise, the response includes a current ETag and task object.
Comments
0 comments
Please sign in to leave a comment.