LibraryLink ToToggle FramesPrintFeedback

Chapter 4. Returning Information to the Consumer

Returning plain Java constructs
Fine tuning an application's responses
Basics of building responses
Creating responses for common use cases
Handling more advanced responses
Returning entities with generic type information

The information returned to the consumer determines the exact type of object a resource method returns. This may seem obvious, but the mapping between Java return objects and what is returned to a RESTful consumer is not one-to-one. At a minimum, RESTful consumers need to be returned a valid HTTP return code in addition to any response entity body. The mapping of the data contained within a Java object to a response entity is effected by the MIME types a consumer is willing to accept.

To address the issues involved in mapping Java object to RESTful response messages, resource methods are allowed to return four types of Java constructs: