繁体   English   中英

强制CURL请求不查找响应PHP

[英]Force CURL request to not look for a response PHP

编辑:正确的做法是从Node-red发送响应,如下面指出的hardillb。

我的CURL请求工作正常,但我只需要让页面访问网址而不是等待响应。 我已经尝试了我能想到的每一个组合,我的浏览器仍在等待服务器响应,直到超时。

$url = 'http://example.com:1880/get?temperature='.$temperature;
$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, 1);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);


// 3. execute and fetch the resulting HTML output
$output = curl_exec($ch);

// 4. free up the curl handle
curl_close($ch);
}

正如评论中所提到的那样。

正确的解决方案是确保您的http-in节点与Node-RED流中的http响应节点配对

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM