简体   繁体   中英

Is it necessary to send statusCode while returning a response from the lambda function using node.js?

const response = {
    statusCode: 200,
    body: JSON.stringify('File Uploaded Successfully.')
};

return response;

I am guessing you are looking at lambda template, which include statusCode in the return but there is no requirement to return a status code, or in fact, anything at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM