Horde_Service_Scribd::getHttpClient PHP Method

getHttpClient() public static method

Gets the HTTP client object.
public static getHttpClient ( ) : Horde_Http_Client
return Horde_Http_Client
    public static function getHttpClient()
    {
        if (!self::$_httpClient) {
            self::$_httpClient = new Horde_Http_Client();
        }
        return self::$_httpClient;
    }

Usage Example

Example #1
0
 public function run()
 {
     $args = array_merge($this->_args, $this->_config, array('method' => $this->_method));
     if (!empty($this->_config['api_secret'])) {
         $args['api_sig'] = $this->_sign($args);
     }
     $client = Horde_Service_Scribd::getHttpClient();
     $response = $client->post(Horde_Service_Scribd::ENDPOINT, $args);
     return new Horde_Service_Scribd_Response($response->getBody());
 }