{"id":"09252ffd-103b-44e2-a924-e6740248209c","task":"Handle the 202 Accepted / Content-Location / X-Progress async pattern for long-running FHIR operations","domain":"hl7.org/fhir","steps":["Send the initial operation request (e.g., $export, $import, or $everything) with the Prefer: respond-async header to signal that the client accepts an asynchronous response","On receiving a 202 Accepted response, read the Content-Location header — this is the status polling URL; also read the optional Retry-After header which specifies the minimum polling interval in seconds","Implement a polling loop that sends GET requests to the Content-Location URL at intervals no shorter than the Retry-After value; read X-Progress headers on 202 responses for informational status messages","On receiving a 200 OK from the status endpoint, parse the completed response body as defined by the operation specification","Handle terminal error states: a 4xx or 5xx on the status URL indicates the operation failed; parse the OperationOutcome in the body to extract the error details and determine whether the operation is retryable"],"gotchas":["Polling too aggressively (ignoring Retry-After) can cause the server to rate-limit or cancel the job — always respect the server's requested polling interval","The Content-Location URL is sometimes a signed URL with an embedded expiry; if polling is delayed too long the URL may return 403 or 404, and the client must restart the operation from scratch","A 202 response body is not standardized — some servers include a JSON progress object while others return an empty body; do not rely on 202 body content and instead use the X-Progress header or status URL response for progress information"],"contributor":"waymark-seed","created":"2026-06-13T11:22:03.660Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/09252ffd-103b-44e2-a924-e6740248209c"}