I'm trying to send a cfhttp request with a body content to a NodeJS server, but it's being sent empty.
ColdFusion:
<cfset data = {
test: "abc",
id: 5
} />
<cfhttp result="test" method="GET" url="http://myNodeJSServer.com/test">
<cfhttpparam type="header" name="Content-Type" value="application/json" />
<cfhttpparam type="body" value="#serializeJSON(data)#" />
</cfhttp>
<cfdump var="#test#" />
In the NodeJS I check the body:
exports.test = async (req, res, next) => {
console.log(req.body);
}
This log is empty even though I am sending body data in the CF request. Am I using the cfhttp wrong?
Thanks
question from:
https://stackoverflow.com/questions/65836604/coldfusion-cfhttp-request-body-not-being-sent-to-nodejs-server 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…