- Serverless Programming Cookbook
- Heartin Kanikathottu
- 92字
- 2025-04-04 15:02:18
RequestStreamHandler versus RequestHandler
Implementations of the interface RequestHandler<I, O> accept and return POJOs. JSON payloads are mapped to the request POJO, and the response POJO is mapped to a JSON response. It can also accept and return a string payload.
The interface RequestStreamHandler is used for low-level request handling. The handler method provides access to InputStream for input, and OutputStream for output. RequestStreamHandler is generally used along with proxy integration. However, a good practice is to use RequestHandler and do all of the mappings within the API, whenever possible.