Request
The request class allows you to parse the event that was invoked through an API Gateway or Application Load Balancer.
So you don't need to use all the functionality of the paths, api, errors, etc., you can use it in your Lambda handler
function.
Example:
exports.handler = (event, context) => {
const request = new ApiRequest(event);
console.log(request.query);
console.log(request.params);
console.log(request.body);
};
NOTE: Remember that while the Request class is independent it uses some functions that are within
utils
andhttp
.
Last updated
Was this helpful?