{"id":304,"date":"2011-07-07T22:27:48","date_gmt":"2011-07-07T22:27:48","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=304"},"modified":"2011-07-07T22:27:48","modified_gmt":"2011-07-07T22:27:48","slug":"coldfusion-facebook-unsupported-post-request","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/coldfusion-facebook-unsupported-post-request\/","title":{"rendered":"ColdFusion Facebook &#8211; unsupported post request"},"content":{"rendered":"<p>I&#39;ve you&#39;ve searched other posts, they&#39;ve not doubt recommended that you URL Encode your parameters, put the access token in a <a class=\"target-blank\" href=\"http:\/\/livedocs.adobe.com\/coldfusion\/8\/htmldocs\/help.html?content=Tags_g-h_10.html\">&lt;cfhttpparam&gt;<\/a>, specify a content type, etc.<\/p>\n<p>But, there&#39;s one ColdFusion specific &quot;issue&quot; that many posts neglect.<\/p>\n<p>That &quot;issue&quot; is the way ColdFusion stores structure keys &#8211; all uppercase.<\/p>\n<p>If you&#39;ve Serialized a Structure to a JSON object, the keys will be all uppercase. Furthermore, if you are sending parameters that come from a structure, they need to be properly &quot;cased&quot;.<\/p>\n<p>See the example below:<\/p>\n<p><code>&lt;cfset oRequest[1] = {method = &quot;GET&quot;, relative_url = &quot;me&quot;}&gt;<br \/>\n\t&lt;cfset oRequest[2] = {method = &quot;GET&quot;, relative_url = &quot;me\/friends?limit=50&quot;}&gt;<\/code><\/p>\n<p>\t<code>&lt;cfset oRequest = SerializeJSON(oRequest)&gt;<br \/>\n\t&lt;cfset oRequest = Replace(oRequest, &quot;METHOD&quot;, &quot;method&quot;, &quot;ALL&quot;)&gt;<br \/>\n\t&lt;cfset oRequest = Replace(oRequest, &quot;RELATIVE_URL&quot;, &quot;relative_url&quot;, &quot;ALL&quot;)&gt;<\/code><\/p>\n<p><code>&lt;cfhttp url=&quot;https:\/\/graph.facebook.com&quot; method=&quot;POST&quot;&gt;<br \/>\n\t&nbsp;&nbsp;&nbsp; &lt;cfhttpparam type=&quot;url&quot; name=&quot;access_token&quot; value=&quot;#arguments.access_token#&quot;&gt;<br \/>\n\t&nbsp;&nbsp;&nbsp; &lt;cfloop collection=&quot;#postParams#&quot; item=&quot;param&quot;&gt;<br \/>\n\t&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &lt;cfhttpparam type=&quot;url&quot; name=&quot;#<strong>lcase<\/strong>(param)#&quot; value=&quot;#postParams[param]#&quot;&gt;<br \/>\n\t&nbsp;&nbsp;&nbsp; &lt;\/cfloop&gt;<br \/>\n\t&lt;\/cfhttp&gt;&nbsp;&nbsp;&nbsp; <br \/>\n\t<\/code><\/p>\n<p>Note the lcase wrapping the parameter. This may not apply to all parameters, but it&#39;s important to note that the parameter is case-sensitive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I&#39;ve you&#39;ve searched other posts, they&#39;ve not doubt recommended that you URL Encode your parameters, put the access token in a &lt;cfhttpparam&gt;, specify a content&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[77,34],"tags":[102],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/304"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=304"}],"version-history":[{"count":1,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/304\/revisions"}],"predecessor-version":[{"id":305,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/304\/revisions\/305"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}