[英]posting to pingomatic with curl is not allowed
I posted to pingomatic using curl with code like this 我使用curl和这样的代码发布到pingomatic
$curl = curl_init($this->buildURL());
curl_exec($curl);
But got the reply 但是得到了答复
You are too awesome for Ping-o-matic
Why am I too awesome for Ping-o-matic? 为什么我对Ping-o-matic太赞了?
EDIT 编辑
I am posting to pingomatic but not POST
ing to pingomatic. 我张贴到pingomatic而不是
POST
ING于pingomatic。 Their setup just takes a simple GET
request 他们的设置只需要一个简单的
GET
请求
Pingomatic requires the user agent header be set. Pingomatic要求设置用户代理标头。 Adding this fixes the problem:
添加此操作可解决问题:
curl_setopt( $curl, CURLOPT_USERAGENT, "Mozilla/5.0" );
The code would then look like 该代码然后看起来像
$curl = curl_init($this->buildURL());
curl_setopt( $curl, CURLOPT_USERAGENT, "Mozilla/5.0" );
curl_exec($curl);
Source: http://www.krunk4ever.com/blog/2011/12/21/you-are-too-awesome-for-ping-o-matic/ 资料来源: http : //www.krunk4ever.com/blog/2011/12/21/you-are-too-awesome-for-ping-o-matic/
Github project: https://github.com/DynamiX-Web-Design/DxPingomatic Github项目: https : //github.com/DynamiX-Web-Design/DxPingomatic
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.