我正在尝试转换旧的CF脚本。唯一的问题是我正在使用CommandBox,我似乎不能让Fiddler向我展示这个请求在实际发布时是什么样子的。有人知道这个发出的Post请求是什么样子的吗?
到目前为止,我已经尝试了各种选择,但都没有奏效。
任何帮助都将不胜感激
<!---
Cold Fusion 4.0.1
--->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head></head>
<body>
<cfif isdefined("Form.thisid")>
<!--- Input Form Parameters --->
<cfset InputPbn = Form.thisid>
<cfoutput>
<h1>Raw XML data for #thisid#</h1>
</cfoutput>
<cfelse>
<h1>A valid thisid was not provided</h1>
<cfabort>
</cfif>
<!--- Assemble the user's input into structure --->
<CFSCRIPT>
// New request structure to pass
Request = StructNew();
Request.thisid = "#Inputthisid#";
host_url = "http://myurl/get_info_wddx.cfm";
Request["LINK_KEY"] = "1234";
</CFSCRIPT>
<!--- Convert the structure to WDDX Packet --->
<CFWDDX
INPUT="#Request#"
OUTPUT="RequestAsWDDX"
ACTION="CFML2WDDX"
>
<cfoutput>RequestAsWDDX #HTMLEditFormat(RequestAsWDDX)#<br/></cfoutput>
<!--- Post the WDDX Packet to the host page as a form field --->
<CFTRY>
<CFHTTP URL="#host_url#" METHOD="POST">
<CFHTTPPARAM
NAME="WDDXContent"
VALUE="#RequestAsWDDX#"
TYPE="FORMFIELD"
>
</CFHTTP>
<CFCATCH TYPE="Any">
WDDX - HTTP Error<BR>
<CFOUTPUT>#HTMLEditFormat(CFHTTP.FileContent)#</CFOUTPUT><BR>
<CFABORT>
</CFCATCH>
</CFTRY>
<!--- Extract recordset from WDDX Packet in host's response --->
<cfif FindNoCase("<META",CFHTTP.FileContent) >
<cfset pos = FindNoCase(">",CFHTTP.FileContent)>
<cfset wddx_strg = Right(CFHTTP.FileContent,(Len(CFHTTP.FileContent)-pos-1))>
<cfelse>
<cfset wddx_strg = CFHTTP.FileContent>
</cfif>
...
</body>
</html>发布于 2020-11-21 02:44:23
我严重地过度复杂化了这个ha,只需要使用" WDDXContent“作为键,使用WDDXContent值作为值。
编辑:我在这一点上没有代码,只是能够让fiddler通过添加标题键"WDDXContent“和值来重现它
<wddxPacket version='1.0'><header/><data><struct><var name='link_key'><string>1234</string></var><var name='id'><string>[id here]</string></var></struct></data></wddxPacket>https://stackoverflow.com/questions/64931775
复制相似问题