Copy link to clipboard
Copied
Hi ! Dear experts
I wrote a simple program to send LINE notifications to customer groups via IFTTT.
Just pass three simple URL parameters, which are as follows:
<CFHTTP Url=https://maker.ifttt.com/trigger/mic0121_line/with/key/boYiM.... Method="get" Charset="utf-8" ResolveUrl="Yes">
<CFHTTPPARAM Type=“url” Name=“value1” Value='test_url_01'>
<CFHTTPPARAM Type="url" Name="value2" Value='測試參數 2' >
<CFHTTPPARAM Type="url" Name="value3" Value='測試參數3' >
</CFHTTP>
mic0121_line is the LINE customer group code defined in IFTTT, value1, value2, value3 are 3 URL parameters, some of which are Chinese Traditional characters (big5 code).
These codes are OK on the CF2021 Update5 test on ColdFusion Fiddle.
But why can't I send it properly when executed on my installed CF2021 Update5 computer.
Are there any settings that need to be changed in CF2021 Adminstrator?
Copy link to clipboard
Copied
Open /cfusion/bin/jvm.config in a text editor. Ensure that java.args contains the following flag:
-Dfile.encoding=UTF-8
If you add the flag, you will have to restart ColdFusion.
Copy link to clipboard
Copied
Thank you for your reply !
I followed your suggestion to set up and restart and still can't send LINE notifications. But executing on my another CF2016 computer and ColdFusion Fiddle CF2021 Update5 are OK.
Copy link to clipboard
Copied
Oh, I have just seen something odd. The code sample you posted above has curly quotes:
“url” Name=“value1”
Replace them with normal double quotes or with single quotes:
"url" Name="value1"
'url' Name='value1'
Copy link to clipboard
Copied
Thank you for your new reply, I tried single quotes and double quotes, or mixed quotes and the result is the same, it works correctly in CF2016 and ColdFusion Fiddle CF2021 Update5, but not from my own CF2021 Update5 computer to send LINE notifications.
Copy link to clipboard
Copied
There's something else. Replace
Url=https://maker.ifttt.com/trigger/mic0121_line/with/key/boYiM
with
Url="https://maker.ifttt.com/trigger/mic0121_line/with/key/boYiM"
Copy link to clipboard
Copied
Copy the following code and test with it.
<CFHTTP Url="https://maker.ifttt.com/trigger/mic0121_line/with/key/boYiM" Method="get" Charset="utf-8" ResolveUrl="Yes">
<CFHTTPPARAM Type="url" Name="value1" Value='test_url_01'>
<CFHTTPPARAM Type="url" Name="value2" Value='測試參數 2' >
<CFHTTPPARAM Type="url" Name="value3" Value='測試參數3' >
</CFHTTP>
<cfdump var="#cfhttp#" >
What happens when you do?
Copy link to clipboard
Copied
Help us help you: what's the error or result you're getting?
You've said only that you "can't send it properly". What tells you that? What's in the cfhttp.filecontent, or indeed in a dump of the cfhttp scope?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Ok, thanks for that. And based on it, I'd say that a likely difference between your machine and the cfiddle is that you may not have updated that Java that underlies your cf. For more on how that's a common cause of such cfhttp failures, as well as how to go about resolving the matter (updating the Java cf uses), see my blog post on the cf portal:
https://coldfusion.adobe.com/2019/06/error-calling-cf-via-https-solved-updating-jvm/
And as for how to detect the version of Java you're running, I have a post on that as well:
https://www.carehart.org/blog/2021/4/5/Confirming-ColdFusions-Java-version-via-CFML-code
And if you have trouble afrtet updating the jvm, I have a post on that as well:
https://www.carehart.org/blog/2014/12/11/help_I_updated_CFs_JVM_and_it_wont_start
Let us know how things go.
Copy link to clipboard
Copied
Thank you very much ! I'll try it.