6

Here's my question of the day. Let's say I have this on one page:

start.cfm

<cfset body = { "stuff": [ 1,2,3,4,5 ] }>

<cfhttp url="end.cfm" method="post" result="httpResp" timeout="60">
    <cfhttpparam type="header" name="Content-Type" value="application/json">
    <cfhttpparam type="body" value="#serializeJSON(body)#">
</cfhttp>

I can't figure out what end.cfm needs to have to output what's in the body. I've tried to cfdump everything from variables to form to cgi but I can't get to it. What am I missing?

Sung
  • 480
  • 2
  • 11

2 Answers2

10

Such a dumb question that I was able to answer it with some additional Googling.

 <cfdump var="#GetHttpRequestData()#">
James A Mohler
  • 11,060
  • 15
  • 46
  • 72
Sung
  • 480
  • 2
  • 11
1

An alternative to the "start and end page to see what's in the request" solution is to use Hyper:

https://www.forgebox.io/view/hyper

It wraps cfhttp but does so in a manner that lets you re-use elements of your request that are shared with other calls to the same endpoints. It's especially useful when paired with Wirebox and Coldbox but these are not necessary.

Aquitaine
  • 96
  • 5
  • Thanks for this...first time seeing Forgebox. CommandBox really has breathed new life into CFML, hasn't it? Great to see my favorite language receiving a second wind. :-) – Sung Nov 30 '18 at 16:09