Tim
09/06/2024, 8:16 PMcfhttpparam type="url"
, or do I have to make sure to encode those myself?Tim
09/09/2024, 3:26 PM<http://api.site.com/api/v#encodeForURL(versionNumber)#/#encodeForURL(taxYear)#/#encodeForURL(id)#|api.site.com/api/v#encodeForURL(versionNumber)#/#encodeForURL(taxYear)#/#encodeForURL(id)#>
is the way to go.bkbk
09/10/2024, 12:54 PM<!--- Test by switching between these two statements: --->
<cfset testVariable="<testTag>">
<!---<cfset testVariable=encodeforurl("<testTag>")>--->
<cfhttp url="<http://localhost:8500/CF_Project/#testVariable#/index.cfm>" result="result">
<cfhttpparam type="url" name="urlVar" value="#testVariable#" >
</cfhttp>
When you use the first statement, then you get the following in the the logs:
> http.log
> "Information","http-nio-8500-exec-9","09/10/24","143322","MyApp1","Starting HTTP request {URL='http://localhost:8500/CF_Project/testTag/index.cfm?urlVar=%3CtestTag%3E', method='get'}"
>
> coldfusion-out-log
> Sep 10, 2024 143322 PM Information [http-nio-8500-exec-9] - Starting HTTP request {URL='http://localhost:8500/CF_Project/testTag/index.cfm?urlVar=%3CtestTag%3E', method='get'}
> Sep 10, 2024 143322 PM Error [http-nio-8500-exec-8] - File not found: /CF_Project/<testTag>/index.cfm The specific sequence of files included or processed is: C:\ColdFusion2023\cfusion\wwwroot\CF_Project\testTag\index.cfm''
When you use the second statement, the logs are:
> http.log
> "Information","http-nio-8500-exec-4","09/10/24","143340","MyApp1","Starting HTTP request {URL='http://localhost:8500/CF_Project/%3CtestTag%3E/index.cfm?urlVar=%253CtestTag%253E', method='get'}"
>
> coldfusion-out-log
> Sep 10, 2024 143340 PM Information [http-nio-8500-exec-4] - Starting HTTP request {URL='http://localhost:8500/CF_Project/%3CtestTag%3E/index.cfm?urlVar=%253CtestTag%253E', method='get'}
> Sep 10, 2024 143340 PM Error [http-nio-8500-exec-3] - File not found: /CF_Project/<testTag>/index.cfm The specific sequence of files included or processed is: C:\ColdFusion2023\cfusion\wwwroot\CF_Project\testTag\index.cfm''
• In the first case, urlVar is '%3CtestTag%3E'. In the second case, it is '%253CtestTag%253E';
• In both cases, the file-not-found log line contains '<testTag>';
• In both cases, the log line for specific file included contains 'testTag'