Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
442 views
in Technique[技术] by (71.8m points)

ColdFusion cfhttp request body not being sent to NodeJS server

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...