Skip to main content
hui-huangk69511027
Participant
February 2, 2023
Question

CF2021 uses CFHTTP to pass parameters to the LINE group via IFTTT

  • February 2, 2023
  • 2 replies
  • 891 views

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?

This topic has been closed for replies.

2 replies

Charlie Arehart
Community Expert
Community Expert
February 18, 2023

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? 

/Charlie (troubleshooter, carehart. org)
hui-huangk69511027
Participant
February 18, 2023

Thank you for your help, output cfhttp variable observation filecontent as shown in the figure, there is a "Connection Failure" error; But on Fiddle execution was successful, and appears "Congratulations ! You've fired the mic0121_line event"。

Charlie Arehart
Community Expert
Community Expert
February 18, 2023

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. 

/Charlie (troubleshooter, carehart. org)
BKBK
Community Expert
Community Expert
February 10, 2023

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.

hui-huangk69511027
Participant
February 11, 2023

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.

BKBK
Community Expert
Community Expert
February 12, 2023

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'