我正在开发一个项目,该项目需要CFHTTP调用来预订发布者,这些发布者会从其网站返回摘录。我的问题是,其中一个发布者的URL被转换为另一个,我似乎无法弄清楚如何从他们那里获取返回的信息。
例如:我要访问的网址是http://www.pubsite.com/bookID/99999 当我在浏览器中访问该网站时,它会自动将我重定向到:http://www.pubsite.com/publisherID/12345
这很好,我可以看到我需要的信息。但是,当我尝试使用Coldfusion自动执行此过程时,我陷入困境。没有办法提前知道该发布者ID是什么。
我的代码是:
<cfset thisURL = "http://www.pubsite.com/bookID/#Trim(arguments.BID)#">
<cfhttp method="get" url="#thisURL#" useragent="#CGI.http_user_agent#" result="objGet" redirect="true" resolveurl="true"/>
<cfdump var="#objGet#" />
返回的转储(header或filecontent)中没有任何内容表示publisherID或真正的登陆URL,我得到的ResponseCode为200,所以我不知道接下来该做什么。
经过大量的Google搜索,我很难过。感谢您的任何见解!
编辑包含转储:
struct
Charset UTF-8
ErrorDetail [empty string]
Filecontent
binary
6033687967848980
[truncated]
Header HTTP/1.1 200 OK X-Firenze-Processing-Time: 422.785 X-Firenze-Processing-Time: 626.552 X-Varnish-Cache: miss X-SmartBan-URL: /content/1177/0959683607085571 X-Firenze-Processing-Times: detect-robot: 0.315 X-Firenze-Processing-Times: add-external-dependencies-info: 0.033 X-Firenze-Processing-Times: content-pre-retrieve: 307.973 X-Firenze-Processing-Times: add-req-info: 10.427 X-Firenze-Processing-Times: authn-authz: 48.986 X-Firenze-Processing-Times: ac-info-request: 4.702 X-Firenze-Processing-Times: login-check: 2.104 X-Firenze-Processing-Times: last-authorized-identity: 1.769 X-Firenze-Processing-Times: retrieve-current-issue: 0.038 X-Firenze-Processing-Times: retrieve-content-page-content: 8.148 X-Firenze-Processing-Times: retrieve-content-page-prev: 3.260 X-Firenze-Processing-Times: retrieve-content-page-next: 3.310 X-Firenze-Processing-Times: retrieve-ads: 9.608 X-Firenze-Processing-Times: retrieve-session-data: 4.577 X-Firenze-Processing-Times: log-builder: 3.302 X-Firenze-Processing-Times: servlet: 207.151 Accept-Ranges: bytes X-XXXX-RequestId: VPTH5atDd2QAABNxM48AAAD- Vary: Accept-Encoding Connection: close X-XXXX-SessionId: m3H5rW2RVOiJ7qb3WTMt0w Set-Cookie: JSESSIONID=FF1AA7D6946D968D5E100C8FD1B8205C.wa126.XXXX.org; Path=/ Age: 0 Content-Type: text/html;charset=UTF-8 Server: nginx/0.7.67 X-Varnish: 2761793264 X-Varnish-Hostname: varnish8.XXXX.org X-SmartBan-Host: hol.XXXX.com x-XXXX-user: memno=1000480925; name=XXXX; type=INST; ip_access=true; password_access=true Date: Mon, 02 Mar 2015 20:28:21 GMT Via: 1.1 varnish
Mimetype text/html
Responseheader
struct
Accept-Ranges bytes
Age 0
Connection close
Content-Type text/html;charset=UTF-8
Date Mon, 02 Mar 2015 20:28:21 GMT
Explanation OK
Http_Version HTTP/1.1
Server nginx/0.7.67
Set-Cookie JSESSIONID=FF1AA7D6946D968D5E100C8FD1B8205C.wa126.XXXX.org; Path=/
Status_Code 200
Vary Accept-Encoding
Via 1.1 varnish
X-Firenze-Processing-Time
struct
1 422.785
2 626.552
X-Firenze-Processing-Times
struct
1 detect-robot: 0.315
10 retrieve-content-page-content: 8.148
11 retrieve-content-page-prev: 3.260
12 retrieve-content-page-next: 3.310
13 retrieve-ads: 9.608
14 retrieve-session-data: 4.577
15 log-builder: 3.302
16 servlet: 207.151
2 add-external-dependencies-info: 0.033
3 content-pre-retrieve: 307.973
4 add-req-info: 10.427
5 authn-authz: 48.986
6 ac-info-request: 4.702
7 login-check: 2.104
8 last-authorized-identity: 1.769
9 retrieve-current-issue: 0.038
X-XXXX-RequestId VPTH5atDd2QAABNxM48AAAD-
X-XXXX-SessionId m3H5rW2RVOiJ7qb3WTMt0w
X-SmartBan-Host hol.XXXX.com
X-SmartBan-URL /content/1177/0959683607085571
X-Varnish 2761793264
X-Varnish-Cache miss
X-Varnish-Hostname varnish8.XXXX.org
x-XXXX-user memno=1000480925; name=XXXX; type=INST; ip_access=true; password_access=true
Statuscode 200 OK
Text YES