]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Rewrote How Blogspam Plugin Made HTTP Requests.
authorChristopher Vollick <psycotica0@gmail.com>
Mon, 22 Feb 2010 16:19:16 +0000 (11:19 -0500)
committerChristopher Vollick <psycotica0@gmail.com>
Mon, 22 Feb 2010 16:19:16 +0000 (11:19 -0500)
The old way didn't seem to work anymore.
It was just sending empty requests.

plugins/BlogspamNetPlugin.php

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