coldfusion - Cfhttp result struct behaves as if null in CF8? -
I'm trying to do some hygiene on the results of the call on Facebook, but Coldfusion is telling me that the variable is zero :
FILECONTENT null & lt; Br> Error occurred on page 66.
The line that is causing this error is here:
& lt; Cfif isDefined ("storeFeedJSON.fileContent") & gt; & Lt; Cfset storeFeedJSON.fileContent = process.CleanBadUnicode ("# storeFeedJSON.fileContent #") & gt; & Lt; / Cfif>
This structure is not clearly zero, but as I have wrapped it in "fixed" and when I dump the store FEEDJSON I can see the file. Content
"data": []}
empty JSON, but still is not empty ...
Edit: I forgot to place the call here:
& lt; Cfset fbURL = "https://graph.facebook.com/#qStoreFBPages.pageID#/#fbEdge#?fields=#fbFields#&since=#fbSinceTime # & amp; # qToken.objectValue #" & gt; & Lt; Cfhttp result = "storeFeedJSON" url = "# fbURL #" method = "get" & gt; & Lt; / Cfhttp & gt;
Which might look something like this:
& lt; cfhttp results = "storeFeedJSON" url = "https: //graph.facebook.? com / 1749383765 / posts areas = created_time & = 1389296713 Since amp; & amp; ACCESS_TOKEN = CAAH6oehQqUUU2IALvt0ZB3mdE6E2LCaldFc1TjIqxALUZBMqZC01O2hQXkOX8ROI9QBHn7WjWrHHneazAP4gWbj0MBsRUlel9TAG52kjBm0bBOUHVEFmEusEUHfhznlqzH1GMgCpCU4z4SmgXU8oFZBPDyAv1ByJu167jgkVd6UROWtDZBNBCP & amp; expires = 5184000" Method = "received" & gt; & Lt; / Cfhttp & gt;
Note that no valid feedback will be given from Facebook because I have changed my token and some other parameters.
I do not think you can reassign the attributes of stored phpSNSST. StoreFeedJSON is the result of your cfhttp, is not it? Such as
& lt; cfhttp url = "xyz" result = "storeFeedJSON">
... which I think is a secure or irreversible data structure You can explicitly pass it as an argument for your work but can put the output in some other variables or directly deserialize json.
& lt; cfset local.cleanFileContent = process.CleanBadUnicode (storeFeedJSON.fileContent) & gt; cfdump var = "#deerializeJSON (local.cleanFileContent) #" & gt;
... and when I am in it, you will want to use getasbinary = "never"
because Facebook probably will give you binary data, or change its Header or something else, and then your code will break if you want to get a binary, then you need cfhttp.fileContent.toString ()
or something like this.
Comments
Post a Comment