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

Class: Services_Akismet_HttpClient_Stream

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

Class Overview

Services_Akismet_HttpClient
   |
   --Services_Akismet_HttpClient_Stream

Streams-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 76]
Streams-based simple HTTP client for accessing the Akismet REST API

This streams-based HTTP client requires PHP to support the stream_context_create(), stream_context_set_option() and file_get_contents() functions and requires that the HTTP stream wrapper is enabled.

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_Stream __construct( string $host, integer $port, string $userAgent)

Creates a new streams-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 HTTP streams wrapper is not enabled 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 ]

post   [line 137]

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 reading from the HTTP stream.
  • 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.