Skip to content

Commit

Permalink
Update acc. to Miha's comments
Browse files Browse the repository at this point in the history
  • Loading branch information
tfrauenstein authored Nov 17, 2023
1 parent 67662f4 commit 519ab6a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions chapters/http-requests.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -419,20 +419,20 @@ processing status and/or result.

We recommend an API design that represents the asynchronous request processing
explicitly via a job resource that has a status and is different from the actual
business resource. For instance, `POST /report-job` returns http status code {202} to
business resource. For instance, `POST /report-jobs` returns http status code {200} to
indicate successful initiation of asynchronous processing together with the job-id
as response payload. The job-id then can be used to poll the processing status
via `GET /report-jobs/{id}` which returns http status code {200} with job status and
optional report-id as response payload. Once returned, the report-id can be used
to fetch the report result via `GET /report/{id}` which returns http status code {200}
and the report object as response payload.
optional report-id as response payload. Once returned with job status `finished`,
the report-id can be used to fetch the result via `GET /reports/{id}` which returns
http status code {200} and the report object as response payload.

In case you do not follow the best practice via a separate job resource, `POST /report`
In case you do not follow the best practice via a separate job resource, `POST /reports`
returns http status code {202} to indicate successful initiation of asynchronous
processing together with the report-id as response payload. The report-id can be
used to fetch the report result via `GET /report/{id}` which returns either http status
code {200} and the report object response payload or status code {202} without the
report object response payload depending on the asynchronous processing status.
used to fetch the report result via `GET /reports/{id}` which returns either http status
code {200} and the report object response payload or status code {202} without
response payload depending on the asynchronous processing status.
Hint: Do _not_ use response code {204} or {404} instead of {202} here -- it is misleading
(neither is the processing successfully finished, nor do we want to suggest a client failure).

Expand Down

0 comments on commit 519ab6a

Please sign in to comment.