O'Reilly logo

RESTful Java Patterns and Best Practices by Bhakti Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Asynchronous resources best practices

The following section lists the best practices when working with asynchronous RESTful resources.

Sending a 202 Accepted message

For asynchronous requests/responses, the API should send back a 202 Accepted message, in case the request is valid and the resource may be available in time, even if it is a few seconds. 202 Accepted means the request has been accepted for processing and the resource will be available shortly. The 202 Accepted message should specify the Location header, which can be used by the client to know where the resource will be available once it is created. The API should not send back a 201 Created message if the response is not available immediately.

Setting expiration for objects in the queue ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required