Javascript 转义Json属性名
nodejslambda应该返回有效负载 { “状态代码”:200, “正文”:{ “客户代码”:“CCode”, “客户类型”:“客户类型” } } 请注意属性名称中的“/” 我无法在Lambda中转义此属性名称Javascript 转义Json属性名,javascript,node.js,json,attributes,escaping,Javascript,Node.js,Json,Attributes,Escaping,nodejslambda应该返回有效负载 { “状态代码”:200, “正文”:{ “客户代码”:“CCode”, “客户类型”:“客户类型” } } 请注意属性名称中的“/” 我无法在Lambda中转义此属性名称 这很有效 但不是这个 任何线索。干杯为什么没有用: 事件[“c_类型\客户类型”] exports.handler = async (event) => { // TODO implement event.ctype__customer_type =
这很有效
但不是这个
任何线索。干杯为什么没有用:
事件[“c_类型\客户类型”]
exports.handler = async (event) => {
// TODO implement
event.ctype__customer_type = "Customer Type";
const response = {
statusCode: 200,
body: event,
};
return response;
};
exports.handler = async (event) => {
// TODO implement
event.c_type_\/_customer_type = "Customer Type";
const response = {
statusCode: 200,
body: event,
};
return response;
};