Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I was having the same 409 response issue when using the Zend_Gdata_Calendar library. There is an open bug on the Zend framework bugtracker. See <a href="http://zendframework.com/issues/browse/ZF-10194" rel="nofollow">http://zendframework.com/issues/browse/ZF-10194</a></p> <p>It seems to boil down to the lack of a "If-Match" header being set by the Gdata_App class or one of the child classes in the chain.</p> <p>To fix it for the Calendar API I've overridden the Zend_Gdata_Calendar class and instantiated my class instead of that one:</p> <pre><code>class Zend_Gdata_Calendar_Fixed extends \Zend_Gdata_Calendar { /** * Overridden to fix an issue with the HTTP request/response for deleting. * @link http://zendframework.com/issues/browse/ZF-10194 */ public function prepareRequest($method, $url = null, $headers = array(), $data = null, $contentTypeOverride = null) { $request = parent::prepareRequest($method, $url, $headers, $data, $contentTypeOverride); if($request['method'] == 'DELETE') { // Default to any $request['headers']['If-Match'] = '*'; if($data instanceof \Zend_Gdata_App_MediaSource) { $rawData = $data-&gt;encode(); if(isset($rawData-&gt;etag) &amp;&amp; $rawData-&gt;etag != '') { // Set specific match $request['headers']['If-Match'] = $rawData-&gt;etag; } } } return $request; } } </code></pre> <p>Then use it:</p> <pre><code>... $gdata = new Zend_Gdata_Calendar_Fixed($httpClient); ... </code></pre> <p>I imagine you could do the same thing but overriding the Zend_Gdata_Docs class instead.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload