Can someone make me checkout below? I am trying to communicate with Vzaar (.com) and I can not author it seems that I am sending the correct The problem API accepts only accept requests DOH! authority header, but I am not 100%, I do not think What else is this
class vzaar {/ ** * * @var zend_Oauth_Token_Access * / protected $ _oAuth; / ** * * @ War Zend_OUount_Lyant * / Protected $ _oClient; Protected $ _sUsername; Secure $ _sSecret; Secure $ _sEndPoint = 'http://vzaar.com/api/'; Public function __ composition ($ s u name, $ sSecret) {$ this- & gt; _sUsername = $ sUsername; $ This- & gt; _sSecret = $ sSecret; $ This- & gt; _oAuth = New Zend_Oauth_Token_Access (); $ This- & gt; _oAuth-> SetToken ($ this-> _sUsername); $ This- & gt; _oAuth-> SetTokenSecret ($ this-> _sSecret); $ This- & gt; _oClient = $ this- & gt; _oAuth-> GetHttpClient (array ()); } Public function getVideos ($ sUsername = null) {if (tap === $ sUsername) {$ user username = $ this- & gt; _sUsername; } Return $ $ - $ ($ s U. name '/ video'); } Secure Work _request ($ sUri) {$ this- & gt; _oClient- & gt; SetURI ($ this-> _sEndPoint. 'Test / whoami'); $ This- & gt; _oClient- & gt; SetURI ($ this-> _sEndPoint. $ SURI '.json'); $ This- & gt; _oClient- & gt; PrepareOauth (); Zend_Debug :: Dump ($ this-> _oClient- & gt; getUri (true)); Zend_Debug :: Dump ($ this-> _oClient- & gt; getHeader ('Authority')); $ ORequest = $ this- & gt; _oClient- & gt; request (); Zend_Debug :: Dump ($ oRequest-> getHeaders ()); Zend_Debug :: Dump ($ oRequest-> getRawBody ()); Return Zend_Json :: Decode ($ oRequest-> getBody ()); }}
public function __ composition ($ s u name, $ sSecret) {/ snip *** / $ this- & gt; _oClient = $ this- & gt; _oAuth-> GetHttpClient array ('requestMethod' => Zend_Oauth_Client :: GET); / *** snippet *** /}
Comments
Post a Comment