简体   繁体   中英

posting to pingomatic with curl is not allowed

I posted to pingomatic using curl with code like this

$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?

EDIT

I am posting to pingomatic but not POST ing to pingomatic. Their setup just takes a simple GET request

Pingomatic requires the user agent header be set. 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/

Github project: https://github.com/DynamiX-Web-Design/DxPingomatic

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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