- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 API,它登录一个帐户,然后对我想通过 CFHTTP 请求出价的项目执行搜索,如下所示。
搜索.cfm:
<cfinclude template="logMeIn.cfm" />
<cfhttp url="https://utas.fut.ea.com/ut/game/fifa14/transfermarket?maxb=1800000&start=0&num=16&type=player&maskedDefId=158023" method="POST" result="Get">
<cfhttpparam type="header" name="Cache-Control" value="no-cache" />
<cfhttpparam type="header" name="Host" value="utas.fut.ea.com" />
<cfhttpparam type="header" name="Referer" value="http://cdn.easf.www.easports.com/soccer/static/flash/futFifaUltimateTeamPlugin/FifaUltimateTeam.swf" />
<cfhttpparam type="header" name="X-HTTP-Method-Override" value="GET" />
<cfhttpparam type="header" name="X-UT-PHISHING-TOKEN" value="#ListLast(Session.searchAccount40PhishingKey,'=')#" />
<cfhttpparam type="header" name="X-UT-SID" value="#Session.searchAccount40SessionKey#" />
</cfhttp>
<cfscript>
Variables.email = "XYZ@example.com";
Variables.password = "password";
Variables.secretAnswer = "secretAnswer";
Session.searchAccountGamertag = "WirierJupiter11";
Variables.doReload = 0;
Variables.deviceView = "device=not_mobile";
</cfscript>
<cfhttp url="http://www.easports.com/uk/fifa/football-club/ultimate-team" method="GET" result="stage1" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Host" value="www.easports.com" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfif StructKeyExists(Stage1.ResponseHeader,"Location")>
<cfscript>
Variables.stage2URL = Stage1.ResponseHeader['Location'];
Variables.returnedCookies = Stage1.ResponseHeader['Set-Cookie'];
Variables.easfcWebSessionStr = Variables.returnedCookies[1];
Variables.easfcWebSession = ListFirst(Variables.easfcWebSessionStr,";");
Variables.hlStr = Variables.returnedCookies[2];
Variables.hl = ListFirst(Variables.hlStr,";");
Variables.xsrfTokenStr = Variables.returnedCookies[3];
Variables.xsrfToken = ListFirst(Variables.xsrfTokenStr,";");
</cfscript>
<cfhttp url="#Variables.stage2URL#" method="GET" result="Stage2" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Host" value="accounts.ea.com" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"Stage2") AND StructKeyExists(Stage2.ResponseHeader,"Location")>
<cfscript>
Variables.stage3URL = Stage2.ResponseHeader['Location'];
</cfscript>
<cfhttp url="#Variables.stage3URL#" method="GET" result="Stage3" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Host" value="signin.ea.com" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"Stage3") AND StructKeyExists(Stage3.ResponseHeader,"Location")>
<cfscript>
Variables.stage4URL = Stage3.ResponseHeader['Location'];
Variables.jSessionStr = Stage3.ResponseHeader['Set-Cookie'];
Variables.jSession = ListFirst(Variables.jSessionStr,";");
</cfscript>
<cfhttp url="#Variables.stage4URL#" method="GET" result="Stage4" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Cookie" value="#Variables.jSession#" />
<cfhttpparam type="header" name="Host" value="signin.ea.com" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfscript>
Variables.bodyContent = "email=#Variables.email#&password=#Variables.password#&_rememberMe=on&rememberMe=on&_eventId=submit&facebookAuth=";
Variables.contentLength = Len(Variables.bodyContent);
</cfscript>
<cfhttp url="#Variables.stage4URL#" method="POST" result="Stage5" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Cache-Control" value="no-cache" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Content-Length" value="#Variables.contentLength#" />
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
<cfhttpparam type="header" name="Cookie" value="#Variables.jSession#" />
<cfhttpparam type="header" name="Host" value="signin.ea.com" />
<cfhttpparam type="header" name="Referer" value="#Variables.stage4URL#" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
<cfhttpparam type="body" value="#Variables.bodyContent#" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"Stage5") AND StructKeyExists(Stage5.ResponseHeader,"Location")>
<cfscript>
Variables.stage6URL = Stage5.ResponseHeader['Location'];
Variables.returnedCookies = Stage5.ResponseHeader['Set-Cookie'];
Variables.webunStr = Variables.returnedCookies[3];
Variables.webun = ListFirst(Variables.webunStr,";");
Variables.isPogoStr = Variables.returnedCookies[4];
Variables.isPogo = ListFirst(Variables.isPogoStr,";");
</cfscript>
<cfhttp url="#Variables.stage6URL#" method="GET" result="Stage6" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Cache-Control" value="no-cache" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Cookie" value="s_sivo=US%3AORIGIN%3ANONE; s_cc=true; s_ria=flash%2010%7Csilverlight%202.9; s_pv=NA%3AUS%3ASTORE%3ANONE%3ASTORE%3ANONE%3AORIGIN%3ANONE%3ALOGIN; s_nr1=1379427845791-NEW; s_sq=%5B%5BB%5D%5D; __utma=103303007.1129861060.1379427834.1379427834.1379427834.1; __utmb=103303007.1.10.1379427834; __utmc=103303007; __utmz=103303007.1379427834.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); s_ppv=85">
<cfhttpparam type="header" name="Host" value="accounts.ea.com" />
<cfhttpparam type="header" name="Referer" value="#Variables.stage4URL#" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"Stage6") AND StructKeyExists(Stage6.ResponseHeader,"Location")>
<cfscript>
Variables.stage7URL = Stage6.ResponseHeader['Location'];
Variables.returnedCookies = Stage6.ResponseHeader['Set-Cookie'];
Variables.sidStr = Variables.returnedCookies[1];
Variables.sid = ListFirst(Variables.sidStr,";");
Variables.remidStr = Variables.returnedCookies[2];
Variables.remid = ListFirst(Variables.remidStr,";");
Variables.cookieStr = Variables.easfcWebSession & "; " & Variables.hl & "; " & Variables.xsrfToken;
</cfscript>
<cfhttp url="#Variables.stage7URL#" method="GET" result="Stage7" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Cache-Control" value="no-cache" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Cookie" value="#Variables.cookieStr#" />
<cfhttpparam type="header" name="Host" value="www.easports.com" />
<cfhttpparam type="header" name="Pragma" value="no-cache" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"Stage7") AND StructKeyExists(Stage7.ResponseHeader,"Location")>
<cfscript>
Variables.stage8URL = Stage7.ResponseHeader['Location'];
Variables.easfcWebSessionStr = Stage7.ResponseHeader['Set-Cookie'];
Variables.easfcWebSession = ListFirst(Variables.easfcWebSessionStr,";");
Variables.cookieStr = Variables.easfcWebSession & "; " & Variables.hl & "; " & Variables.xsrfToken;
</cfscript>
<cfhttp url="#Variables.stage8URL#" method="GET" result="Stage8" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Cache-Control" value="no-cache" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Cookie" value="#Variables.cookieStr#" />
<cfhttpparam type="header" name="Host" value="www.easports.com" />
<cfhttpparam type="header" name="Pragma" value="no-cache" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"Stage8") AND StructKeyExists(Stage8.ResponseHeader,"Set-Cookie")>
<cfscript>
Variables.stage9URL = "http://www.easports.com/iframe/fut/?locale=en_GB&baseShowoffUrl=http%3A%2F%2Fwww.easports.com%2Fuk%2Ffifa%2Ffootball-club%2Fultimate-team%2Fshow-off&guest_app_uri=http%3A%2F%2Fwww.easports.com%2Fuk%2Ffifa%2Ffootball-club%2Fultimate-team";
Variables.returnedCookies = Stage8.ResponseHeader['Set-Cookie'];
Variables.deviceView = ListFirst(Variables.returnedCookies,";");
Variables.cookieStr = Variables.cookieStr & "; " & Variables.deviceView;
</cfscript>
<cfhttp url="#Variables.stage9URL#" method="GET" result="Stage9" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Cookie" value="#Variables.cookieStr#" />
<cfhttpparam type="header" name="Host" value="www.easports.com" />
<cfhttpparam type="header" name="Referer" value="http://www.easports.com/uk/fifa/football-club/ultimate-team" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"Stage9") AND StructKeyExists(Stage9.ResponseHeader,"Location")>
<cfscript>
Variables.stage10URL = Stage9.ResponseHeader['Location'];
Variables.futWebStr = Stage9.ResponseHeader['Set-Cookie'];
Variables.futWeb = ListFirst(Variables.futWebStr,";");
Variables.cookieStr = Variables.remid & "; " & Variables.sid;
</cfscript>
<cfhttp url="#Variables.stage10URL#" method="GET" result="Stage10" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Cookie" value="#Variables.cookieStr#" />
<cfhttpparam type="header" name="Host" value="accounts.ea.com" />
<cfhttpparam type="header" name="Referer" value="http://www.easports.com/uk/fifa/football-club/ultimate-team" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"Stage10") AND StructKeyExists(Stage10.ResponseHeader,"Location")>
<cfscript>
Variables.stage11URL = Stage10.ResponseHeader['Location'];
Variables.sidStr = Stage10.ResponseHeader['Set-Cookie'];
Variables.sid = ListFirst(Variables.sidStr,";");
Variables.cookieStr = Variables.futWeb & "; " & Variables.easfcWebSession & "; " & Variables.hl & "; " & Variables.xsrfToken & "; " & Variables.deviceView;
</cfscript>
<cfhttp url="#Variables.stage11URL#" method="GET" result="Stage11" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Encoding" value="gzip, deflate" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Cookie" value="#Variables.cookieStr#" />
<cfhttpparam type="header" name="Host" value="www.easports.com" />
<cfhttpparam type="header" name="Referer" value="http://www.easports.com/fifa/football-club/ultimate-team" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"Stage11") AND StructKeyExists(Stage11.ResponseHeader,"Location")>
<cfscript>
Variables.stage12URL = Stage11.ResponseHeader['Location'];
Variables.futWebStr = Stage11.ResponseHeader['Set-Cookie'];
Variables.futWeb = ListFirst(Variables.futWebStr,";");
Session.searchAccountCookie = Variables.futWeb & "; " & Variables.easfcWebSession & "; " & Variables.hl & "; " & Variables.xsrfToken & "; " & Variables.deviceView;
</cfscript>
<cfhttp url="#Variables.stage12URL#" method="GET" result="Stage12" redirect="false">
<cfhttpparam type="header" name="Accept" value="text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Cookie" value="#Session.searchAccountCookie#" />
<cfhttpparam type="header" name="Host" value="www.easports.com" />
<cfhttpparam type="header" name="Referer" value="http://www.easports.com/fifa/football-club/ultimate-team" />
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Session,"searchAccountCookie")>
<cfscript>
Variables.data = '{ "isReadOnly": false, "sku": "FUT14WEB", "clientVersion": 1, "nuc": 1000215983198, "nucleusPersonaId": 948682854"nucleusPersonaDisplayName": "WirierJupiter11", "nucleusPersonaPlatform": "360", "locale": "en-GB", "method": "authcode", "priorityLevel":4, "identification": { "authCode": "" } }';
Variables.dataLength = Len(Variables.data);
</cfscript>
<cfhttp url="http://www.easports.com/iframe/fut/p/ut/auth" method="POST" result="sessionIDRequest">
<cfhttpparam type="header" name="Accept" value="application/json, text/javascript" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Content-Length" value="#Variables.dataLength#" />
<cfhttpparam type="header" name="Content-Type" value="application/json" />
<cfhttpparam type="header" name="Cookie" value="#Session.searchAccountCookie#" />
<cfhttpparam type="header" name="Easw-Session-Data-Nucleus-ID" value="1000215983198" />
<cfhttpparam type="header" name="Host" value="www.easports.com" />
<cfhttpparam type="header" name="Pragma" value="no-cache" />
<cfhttpparam type="header" name="Referer" value=" http://www.easports.com/iframe/fut/?baseShowoffUrl=http%3A%2F%2Fwww.easports.com%2Fuk%2Ffifa%2Ffootball-club%2Fultimate-team%2Fshow-off&guest_app_uri=http%3A%2F%2Fwww.easports.com%2Fuk%2Ffifa%2Ffootball-club%2Fultimate-team&locale=en_GB">
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
<cfhttpparam type="header" name="X-UT-Embed-Error" value="true" />
<cfhttpparam type="header" name="X-UT-Route" value="https://utas.fut.ea.com:443" />
<cfhttpparam type="header" name="X-Requested-With" value="XMLHttpRequest" />
<cfhttpparam type="body" value="#Variables.data#" />
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"sessionIDRequest") AND Variables.sessionIDRequest.FileContent NEQ "Connection Failure" AND Variables.sessionIDRequest.StatusCode NEQ "500 Internal Server Error">
<cfscript>
Variables.sessionKeyRequest = REReplace(Variables.sessionIDRequest.FileContent, "^\s*[[:word:]]*\s*\(\s*","");
Variables.sessionKeyRequest = REReplace(Variables.sessionKeyRequest, "\s*\)\s*$", "");
Variables.sessionInfo = DeserializeJSON(Variables.sessionKeyRequest);
Session.searchAccountSessionKey = Variables.sessionInfo.sid;
</cfscript>
<cfhttp url="http://www.easports.com/iframe/fut/p/ut/game/fifa14/phishing/validate" method="POST" result="phishingKeyRequest">
<cfhttpparam type="header" name="Accept" value="application/json" />
<cfhttpparam type="header" name="Accept-Language" value="en-US, en;q=0.5" />
<cfhttpparam type="header" name="Connection" value="keep-alive" />
<cfhttpparam type="header" name="Content-Length" value="39" />
<cfhttpparam type="header" name="Content-Type" value="application/x-www-form-urlencoded" />
<cfhttpparam type="header" name="Cookie" value="#Session.searchAccountCookie#" />
<cfhttpparam type="header" name="Easw-Session-Data-Nucleus-ID" value="1000215983198" />
<cfhttpparam type="header" name="Host" value="www.easports.com" />
<cfhttpparam type="header" name="Pragma" value="no-cache" />
<cfhttpparam type="header" name="Referer" value="http://www.easports.com/iframe/fut/?baseShowoffUrl=http%3A%2F%2Fwww.easports.com%2Fuk%2Ffifa%2Ffootball-club%2Fultimate-team%2Fshow-off&guest_app_uri=http%3A%2F%2Fwww.easports.com%2Fuk%2Ffifa%2Ffootball-club%2Fultimate-team&locale=en_GB">
<cfhttpparam type="header" name="User-Agent" value="Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.110 Safari/537.36" />
<cfhttpparam type="header" name="X-UT-Embed-Error" value="true" />
<cfhttpparam type="header" name="X-UT-Route" value="https://utas.fut.ea.com:443" />
<cfhttpparam type="header" name="X-Requested-With" value="XMLHttpRequest" />
<cfhttpparam type="header" name="X-UT-SID" value="#Session.searchAccountSessionKey#" />
<cfhttpparam type="formField" name="answer" value="#Variables.secretAnswer#">
</cfhttp>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<cfif StructKeyExists(Variables,"phishingKeyRequest") AND StructKeyExists(Variables.phishingKeyRequest.ResponseHeader,"Set-Cookie")>
<cfscript>
Variables.returnedCookies = phishingKeyRequest.ResponseHeader["Set-Cookie"];
Session.searchAccountPhishingKey = ListFirst(Variables.returnedCookies,";");
if (StructKeyExists(Variables,"easfcWebSession")) {
Variables.cookieStr = Variables.easfcWebSession & "; " & Variables.hl & "; " & Variables.xsrfToken & "; device=not_mobile; " & Session.searchAccountPhishingKey;
Session.searchAccountLoggedIn = 1;
Session.searchAccountLoginAttempts = 0;
} else {
Variables.doReload = 1;
}
</cfscript>
<cfelse>
<cfset Variables.doReload = 1 />
</cfif>
<!--- IF RELOAD PAGE FLAG SET TO TRUE RELOAD --->
<cfif Variables.doReload EQ 1>
<!--- RELOAD PAGE --->
<script>
location.reload();
</script>
</cfif>
最佳答案
CFHTTP 将打开一个连接,发出请求,然后关闭连接。如果我没看错,您的 logMeIn.cfm 正在发出 14 个 http 请求。设置每个连接需要花费大量时间。
我认为你有两种选择:
提前登录
是否可以在线程中或使用 CF 调度程序定期运行 logMeIn.cfm 并将 searchAccount40SessionKey 值保留在应用程序范围内?您的代码可以发出请求并查看 session ID 是否仍然有效。如果是,就留下吧。如果没有,请完成登录过程。
如果您的站点支持许多用户,这可能不是一种可扩展的方法。如果它适用于少数人,它可能会起作用
使用不同的 HTTP 库。
CF 附带 HTTPClient(我认为,现在只需下载即可检查)。那有能力做连接管理。这样,您应该能够在所有请求中保持单个连接。这将意味着重写您的大部分代码,但您应该会看到显着的速度提升。您也可以稍微简化一些事情,因为 HTTPClient 可以对 cookie/location 头和重定向进行一些管理。
看看这个答案:Understanding Persistent HTTP Connections in ColdFusion
如果您还没有这样做,请通过 Fiddler 代理您的请求,这样您就可以看到客户端/服务器是如何交互的。要使用 Fiddler,请安装它,启动它,然后修改您的 CFHTTP 调用以使用 proxyServer=localhost 和 proxyPort=8888。然后,您将看到列出的 HTTP 调用。在这种工作中它是无价的。它还可以让您将请求拖到 Composer 选项卡中,对其进行一些编辑,然后重新发送它,这比重新编写代码要快得多,只是为了尝试一些东西。
更新
@CPB07 在评论中添加了更多细节。 session ID 已经缓存并保存在 session 中,这意味着第一个建议已经实现。另一位信息是 search.cfm 每 335 毫秒被调用一次,这就是需要优化的内容。
鉴于此,我能想到的最佳改进是将 search.cfm 中的 CFHTTP 调用切换为使用 HTTPClient。 CF10 附带了 HTTPComponents 的 HTTPClient 的最新版本,因此在 this page 的第 2.3 节中列出的代码应该大致是你所追求的。 2.3.1 节中的示例使用了一个 HTTPContext,它有一个 getCookieStore() 方法,它有一个 addCookie() 方法,它允许您设置 session cookie 并在每个请求中使用它。粗略地说,该代码中 try 块之外的所有内容都可以运行一次并将对象存储在 session 中,然后每次都可以运行实际的请求/连接打开。
另一件要考虑的事情是您首先是如何执行代码的。您说您对线程不太熟悉,我猜这意味着您正在使用调度程序或 AJAX 进行轮询。通过在线程中运行轮询代码,您可能会获得更一致的结果,但这会增加复杂性。
更新 2
使用Fiddler访问search.cfm中的URL,查看统计选项卡,两个关键数字是:
关于web-services - 改善 CFHTTP 响应时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20719219/
我有一些关于 Volley 的问题 如何获得与 volley 库的连接响应时间? 有解决方案吗? 我可以使用计时器来获取响应时间吗?如何使用? 还有在 volley 连接前执行的方法吗? 我的代码是这
我管理一个使用 symfony2 创建的网站,我需要“稳定”它的响应时间。 响应时间从 100 毫秒(下限) float 到 1200 毫秒,并且随机改进(我已经排除了访问依赖性)。 配置如下: Ce
我正在使用门牌号数据查询简单的 Elasticsearch 索引。 ".house-numbers": { "mappings": { "house-number": {
本文分享自华为云社区《【高并发】性能优化有哪些衡量指标?需要注意什么?》,作者:冰河 。 最近,很多小伙伴都在说,我没做过性能优化的工作,在公司只是做些CRUD的工作,接触不到性能优化相关的工作。现在
目前,我正在尝试开发用于即时消息传递的 Android 应用程序。我想在 Ubuntu 服务器上为此使用 ejabberd。只有一个问题。当我首先尝试使用此 xml 行连接到我的 ejabberd 时
好吧,我做了这个很长的查询。它工作完美,但需要 15-30 秒才能给我结果...我不是 SQL 专家,所以我想问是否有办法提高 MySQL 响应时间...也许需要超过1 个查询或类似的内容。 PS:它
我有一个标准用例,用于监控到达我的 Tomcat 服务器的请求的响应时间。我已启用访问日志并将响应时间 (%D) 添加到模式。 现在我想监控我的服务器的响应时间。例如: 过去一小时的平均响应时间是多少
我希望减少 Web 服务器针对给定查询从 API 服务器请求/接收数据的完整时间。 假设 MySQL 是瓶颈,我将 API 服务器数据库更新到 Cassandra,但完成时间仍然相同。可能是其他东西是
我是一个 java 初学者,我正在尝试编写一个机器人来填写一个对我来说非常烦人的表格。 为什么这种形式令人烦恼?想象一下,我必须在该表单中插入一千个不同的值,但它一次只允许我插入一个值。每次插入每个值
有 C++ 桌面应用程序,我需要测量 UI 滞后,因为用户说它有时会滞后。我该如何实现?尝试在操作后将 pywinauto 与计时器启动-停止一起使用,但它单击元素的速度非常慢。另一方面,尝试使用 S
我正在构建一个服务器监控系统,我想向 Web API 发送请求,并在 JSON 对象中获取服务器的健康状况、数据库连接是否正常、响应时间等。 如何实现响应时间,即 Web API 需要多长时间来响应请
我正在尝试加快测试 jetty (将其与使用 apache 进行比较)以提供动态内容。 我正在使用三个客户端线程对此进行测试,一旦响应返回就会再次请求。它们在本地盒子(OSX 10.5.8 mac b
我正在构建一个带有 API 的 PHP 应用程序,该应用程序能够非常快速地(在 100 毫秒内)响应所有请求,并且必须能够每秒处理多达 200 个查询(请求以 JSON 格式,响应需要数据库查找+每次
在 AWS 实例上抛出 Node.JS 并测试请求时间,得到了一些有趣的结果。 我在服务器上使用了以下内容: var http = require('http'); http.createServer
我有一个 API,它登录一个帐户,然后对我想通过 CFHTTP 请求出价的项目执行搜索,如下所示。 搜索.cfm: 登录.cfm:
这些响应时间是来自 JMeter TTFB 还是 TTLB? 最佳答案 响应时间是“到最后一个字节的时间” http://jmeter.512774.n5.nabble.com/JMeter-resu
我知道 LoadRunner 用于系统响应,但我想知道它是否也可以测量,例如渲染时间(大型列表中的数千个项目等)。我想这可以通过验证特定对象出现在 UI 中来完成,但我认为 LoadRunner 不运
我正在制作一个元素(网站),我需要一些建议。我的计划是将 NodeJS 与 express webframework 一起使用。我想让这个网站真正用户友好和友好,就像每个人都希望他们的网站一样。问题是
抱歉我的英语不好,但我尽力了:)我有一些问题,希望我能在这里找到答案。我想在 html/css/js 中创建一个离线聊天机器人并使用 Intel XDK 程序。 我不知道,如何给聊天机器人一个特殊的命
我正在使用 java 脚本/Jquery 从我的客户端代码使用 Microsoft Face api。这是代码。我使用相机捕获图像,然后将该图像转换为 blob 并将其发送到 api。我正在得到结果。
我是一名优秀的程序员,十分优秀!