Services_Akismet
[ class tree: Services_Akismet ] [ index: Services_Akismet ] [ all elements ]

Class: Services_Akismet_HttpClient_Curl

Source Location: /Services_Akismet-1.0.1/Akismet/HttpClient/Curl.php

Class Overview

Services_Akismet_HttpClient
   |
   --Services_Akismet_HttpClient_Curl

cURL-based simple HTTP client for accessing the Akismet REST API


Author(s):

Copyright:

  • 2008 silverorange

Methods


Inherited Variables

Inherited Methods

Class: Services_Akismet_HttpClient

Services_Akismet_HttpClient::__construct()
Creates a new HTTP client for accessing the Akismet REST API
Services_Akismet_HttpClient::factory()
Factory method to instantiate a HTTP client implementation
Services_Akismet_HttpClient::post()
Makes a HTTP POST request on the Akismet API server

Class Details

[line 74]
cURL-based simple HTTP client for accessing the Akismet REST API

This cURL-based HTTP client requires the cURL extension for PHP.

This HTTP client only supports the HTTP POST method since that is all that is needed for the Akismet API.



[ Top ]


Method Detail

__construct (Constructor)   [line 201]

Services_Akismet_HttpClient_Curl __construct( string $host, integer $port, string $userAgent)

Creates a new cURL-based HTTP client for accessing the Akismet REST API

Instances of this HTTP client must be instantiated using the Services_Akismet_HttpClient::factory() method.

  • Throws: PEAR_Exception if the cURL extension is not loaded for this PHP installation.
  • Access: protected

Overrides Services_Akismet_HttpClient::__construct() (Creates a new HTTP client for accessing the Akismet REST API)

Parameters:

string   $host   —  the Akismet API server host name.
integer   $port   —  the TCP/IP connection port of this HTTP client.
string   $userAgent   —  the HTTP user agent of this HTTP client.

[ Top ]

__destruct (Destructor)   [line 179]

void __destruct( )

Disconnects this HTTP client if it is connected when destroyed
  • Access: public

[ Top ]

post   [line 141]

string post( string $path, string $content, [string $apiKey = ''])

Makes a HTTP POST request on the Akismet API server
  • Return: the content of the HTTP response from the Akismet API server.
  • Throws: Services_Akismet_CommunicationException if there is an error getting the cURL response from Akismet API server.
  • Access: public

Overrides Services_Akismet_HttpClient::post() (Makes a HTTP POST request on the Akismet API server)

Parameters:

string   $path   —  the resource to post to.
string   $content   —  the data to post.
string   $apiKey   —  optional. The Wordpress API key to use for the request. If not specified, no API key information is included in the request. This is used for key validation.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:21:08 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.