Rewrote How Blogspam Plugin Made HTTP Requests.

The old way didn't seem to work anymore.
It was just sending empty requests.
This commit is contained in:
Christopher Vollick 2010-02-22 11:19:16 -05:00
parent c74aea589d
commit 1e8e1e836d

View File

@ -72,8 +72,10 @@ class BlogspamNetPlugin extends Plugin
common_debug("Blogspamnet args = " . print_r($args, TRUE)); common_debug("Blogspamnet args = " . print_r($args, TRUE));
$requestBody = xmlrpc_encode_request('testComment', array($args)); $requestBody = xmlrpc_encode_request('testComment', array($args));
$request = HTTPClient::start(); $request = new HTTPClient($this->baseUrl, HTTPClient::METHOD_POST);
$httpResponse = $request->post($this->baseUrl, array('Content-Type: text/xml'), $requestBody); $request->setHeader('Content-Type', 'text/xml');
$request->setBody($requestBody);
$httpResponse = $request->send();
$response = xmlrpc_decode($httpResponse->getBody()); $response = xmlrpc_decode($httpResponse->getBody());
if (xmlrpc_is_fault($response)) { if (xmlrpc_is_fault($response)) {