/** * Add the application_key and private_key into the client's headers * * @param unknown $spore (reference) */ public function execute(&$spore) { // set signature string $this->setSignatureString($spore); $this->_signatureSha1 = sha1($this->_signatureString); // modify the request headers $client = RESTHttpClient::getHttpClient(); $client->createOrUpdateHeader('X-Weborama-AppKey', $this->_applicationKey); $client->createOrUpdateHeader('X-Weborama-Signature', $this->_signatureSha1); $client->createOrUpdateHeader('X-Weborama-User-Email', $this->_userEmail); }
/** * Factory of the class. Lazy connect * * @param string $host * @param integer $port * @param string $user * @param string $pass * @return Http */ public static function connect($baseurl) { self::$_httpClient = new RESTHttpClient($baseurl, false); return self::$_httpClient; }
private function _setContentType($content_type) { $client = RESTHttpClient::getHttpClient(); $client->createOrUpdateHeader('Content-Type', $content_type); }
/** * Set the header * * @param unknown $spore (reference) */ public function execute(&$spore) { // modify the request headers $client = RESTHttpClient::getHttpClient(); $client->createOrUpdateHeader($this->_headerName, $this->_headerValue); }