文、意如
1.字串轉Json
2.Json轉字串
JSON字串:
data_info='{ "urn_token":"aaabbbb", "redirect_uri":"http://192.168.5.1/respond.html"}';
字串轉Json
data_info = JSON.parse(req.body.data_info);
urn_token = data_info.urn_token; //aaabbbb
redirect_uri = data_info.redirect_uri;
console.log(data_info.redirect_uri) //http://192.168.5.1/respond.html
Json轉字串
res.send(JSON.stringify({"redirect_url":data_info}));
Yiru@Studio - 關於我 - 意如