0

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

myTest532 myTest532
  • 1,451
  • 10
  • 24

0 Answers0