Skip to main content
Participant
November 17, 2011
Answered

How to access json data posted to a CF webservice

  • November 17, 2011
  • 2 replies
  • 1822 views

Hi All,

I have a ExtJS app that makes a call to a Coldfusion webservice and sends a json object as part of the POST request. In Firebug I can see the json object being posted but I can't seem to access it in Coldfusion.

Anyone know how or if this is possible?

Thanks,

Orla

    This topic has been closed for replies.
    Correct answer 12Robots

    Try using getHttpRequestData().content

    <cfset myData = deserializeJSON(getHttpRequestData().content) />

    <cfdump var="#myData#" />

    2 replies

    OrlaSAuthor
    Participant
    November 22, 2011

    Thanks...

    The following is exactly what I need as I want to keep the json to pass on to a java webservice call:

    <cfset requestJson = toString(getHttpRequestData().content)>

    12Robots
    12RobotsCorrect answer
    Participating Frequently
    November 17, 2011

    Try using getHttpRequestData().content

    <cfset myData = deserializeJSON(getHttpRequestData().content) />

    <cfdump var="#myData#" />

    Inspiring
    November 17, 2011

    How are you performing your web service call using AJAX?  Are you sure you are really posting the data and not sending the data in the URL scope?