我正在制作一个cfhttp来连接加密页面.似乎对某些网站工作正常.
I/O Exception: Name in certificate `pro.test.com' does not match host name `go.test.com'
Run Code Online (Sandbox Code Playgroud)
即使主机名不匹配,是否有信任该证书的解决方法?
我有一个解析给它的网址的功能,并根据它在该页面上找到的内容决定使用开放图形来显示嵌入的视频,只显示标题等.
我想扩展它以检测直接视频文件或音乐文件是否已作为URL提供.
我根本没有兴趣下载文件的全部内容,但我确实想要首先查看标题是否是音频/ mpg,文本,HTML等.
有没有办法获取远程文件/页面的http标头而不获取所有内容?
使用CFHTTP它将连接并提供我需要的数据,但它会占用处理时间以下载其余内容.
通过了解标题内容,我可以决定是否应该尝试下载整个页面来解析它以获得额外的开放图形数据.
我正在尝试在ColdFusion中重新创建一个PHP函数(因为我不知道PHP)并认为我的大多数函数都不是太糟糕但在处理PHP中的cURL函数时遇到问题.
功能代码是
$cookie_string = $this->EASW_KEY."; ".$this->EASF_SESS ."; ".$this->PHISHKEY;
$ch = curl_init($search);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_COOKIE, $cookie_string);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'x-http-method-override: GET',
$this->XSID)
);
//Contains the JSON file returned
$EAPSEARCH = curl_exec($ch);
curl_close($ch);
unset (List of variables);
Run Code Online (Sandbox Code Playgroud)
我假设CFHTTP功能是我最好的盟友,但不确定如何处理重新编码.有人能指出我正确的方向吗?
我有这个代码:
<cfhttp url="#qCheckSiteID.url#">
<cfdump var="#cfhttp#" />
Run Code Online (Sandbox Code Playgroud)
哪个适用于任何HTTP网址,但不适用于HTTPS.例如,它可以正常使用,https://www.google.com但https://mywebsite.com在CloudFlare下有SSL证书,它失败并出现错误:
I/O异常:证书中的名称"ssl2000.cloudflare.com"与主机名"www.mywebsite.com"不匹配.
任何想法如何传递此错误?
我正在尝试通过重新创建成功的Firebase控制台帖子的输出来通过CFHTTP正确编码对Firebase Cloud Messaging REST API的调用。以下是控制台指出的正确代码
POST /fcm/send HTTP/1.1
Host: fcm.googleapis.com
Content-Type: application/json
Authorization: key=AIzcXE
cache-control: no-cache
{
"to": "e5kpn8h9bR95NuXVHTOi50bCURG0BS4S6ccUm3X5q",
"priority": "high",
"notification" : {
"title": "",
"body" : "This is the actual message content",
"sound": "default",
"image": "https://gladevalleyanimalhospital.net/wp-content/uploads/2017/03/raster-7.png"
}
}
Run Code Online (Sandbox Code Playgroud)
这是我们当前的CFHTTP代码:
<cfhttp method="Post" url="https://fcm.googleapis.com/fcm/send">
<cfhttpparam type="header" name="Authorization" value="key=AIzXE">
<cfhttpparam type="header" name="Content-Type" value="application/json">
<cfhttpparam type="header" name="Postman-Token" value="e19b8abf3f9">
<cfhttpparam type="header" name="cache-control" value="no-cache">
<cfhttpparam type="Formfield" value="3569D24982E3B" name="to">
<cfhttpparam type="Formfield" value="high" name="priority">
<cfhttpparam type="Formfield" value="Test" name="title">
<cfhttpparam type="Formfield" value="This is the actual message content" …Run Code Online (Sandbox Code Playgroud) 我正在尝试执行 cfhttp 帖子,我需要在 URL 变量中包含一个 URL,以指示存放交货收据的位置。
这是我的代码:
<cfhttp result="CFHTTP" method="GET" url="http://xxxxxxxxxxx/send-sms.php?sender=#numbers.number#&to=#get_sms.receiver#&message=#get_sms.msgdata#&dlr-url=#get_sms.dlr_url#">
<cfhttpparam type="formfield" name="sender" value="#numbers.number#">
<cfhttpparam type="formfield" name="to" value="#get_sms.receiver#">
<cfhttpparam type="formfield" name="message" value="#get_sms.msgdata#">
<cfhttpparam type="formfield" name="dlr-url" value="#get_sms.dlr_url#">
</cfhttp>
Run Code Online (Sandbox Code Playgroud)
如果我不包含类似于以下内容的 dlr_url,一切都会正常工作:
我只能假设像“?”这样的项目 而“&”会破坏这个过程。关于如何实现这一点的任何想法?
谢谢大家的帮助。
如何在不中止脚本执行的情况下返回400状态代码并关闭连接?我希望<cfhttp>在返回之前使用但不等待脚本结束来启动脚本的执行.
cfhttp ×7
coldfusion ×7
cfml ×1
cookies ×1
curl ×1
firebase ×1
http-headers ×1
https ×1
php ×1
ssl ×1
url ×1
web-crawler ×1