Link to home
Start Free TrialLog in
Avatar of mackaboogie
mackaboogie

asked on

ColdFusion not showing binary json data in request

I have a listener application that has been working fine for over a year. We recently moved it to a new CF server (same version of CF) and it totally stopped working. I have the incoming request dumping to an email to me so I can see what is going on and it shows binary data in the content body (which should be my JSON packet) but it always appears empty.

Here is roughly what my code looks like....

<cfset x = getHttpRequestData()>
<cfset requestBody = toString(x.content)>
<cfset response = deserializeJSON(requestBody)>

Open in new window


Quite simple. This will throw an error because the requestBody variable will be null and therefore the deserializeJSON will fail. I have tried about everything I could think of and even looked into Ben Nadel's blog about pseudo contructors and issue with the body, but none of that seems to be related to the problem I am having. Attaching a screenshot of the response dump.

Running CF10 update 22
2017-02-20_09h40_10.png
ASKER CERTIFIED SOLUTION
Avatar of _agx_
_agx_
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mackaboogie
mackaboogie

ASKER

That is a great catch!!!! Thank you so much. That little bit of info cleared up everything. How could something sent to my server as a post appear as a get? Because IIS is redirecting... the new server had a URL reWrite setup for SEO friendly URLs. Every incoming request was getting filtered through the url rewrite. I disabled the rules, ran a test and it worked perfectly.
Sometimes you just need a second set of eyes...
Oooh... makes total sense. Rewrite rules are a blessing and a curse sometimes!