1

Before calling the function below, the text1 value was encoded ie:

http://example/exampleProxy.cfc?returnFormat=plain&method=update&id=443&blah=something&text1=bob+bob2%0Abob

But the request that is sent has stripped out the newline character ie

http://example/test/id=443&blah=something&text1=bob+bob2bob

Function:

<cffunction name="update" access="remote" output="yes" returntype="string">
        <cfargument name="id" required="yes" type="string" />
        <cfargument name="blah" required="yes" type="string" />
        <cfargument name="text1" required="yes" type="string" />   

        <cfhttp url="#variables.cString#" method="PUT"      timeout="#variables.HTTP_TIMEOUT#">
            <cfhttpparam name="id" type="url" value="#arguments.id#">
            <cfhttpparam name="blah" type="url" value="#arguments.blah#">
            <cfhttpparam name="text1" type="url" value="#arguments.text1#">
        </cfhttp>
        ...
4

2 回答 2

2

根据您的描述,我怀疑新行字符在那里。但是您将无法通过简单的方式看到它,<cfdump var="...">因为它会显示结果 html。所以任何换行符都会显示为一个空格:

TEXT1: bob bob2 bob  

您要么需要使用format="text"要么<pre>标记。然后你应该在值中看到换行符:

代码:

<cfdump var="#arguments#" format="text">
<pre>TEXT1: #arguments.text1#</pre>

结果:

BLAH: something
ID: 443
TEXT1: bob bob2   <--- new line
bob


TEXT1: bob bob2  <--- new line
bob

我用 CF9 测试了你的代码,新行出现在函数内部和接收页面上。IECGI.QUERY_STRING

  id=443&blah=something&text1=bob%20bob2%0Abob 
于 2012-05-18T02:51:27.160 回答
1

确认是否有任何东西被剥离的另一种方法是运行Fiddler并将 proxyserver="localhost" proxyport="8888" 添加到您的呼叫中。呼叫将通过提琴手进行路由,您可以从那里检查所有参数

于 2012-05-18T06:08:09.253 回答