@@ -140,8 +140,12 @@ public function get($url)
140140 * @return string
141141 */
142142 public function post ($ url , $ postData )
143- {
144- $ ch = $ this ->initRequest ($ url , array ('Content-Type: application/atom+xml ' ));
143+ {
144+ $ headers = array (
145+ 'Content-Type: application/atom+xml ' ,
146+ 'Content-Length: ' . strlen ($ postData ),
147+ );
148+ $ ch = $ this ->initRequest ($ url , $ headers );
145149 curl_setopt ($ ch , CURLOPT_CUSTOMREQUEST , 'POST ' );
146150 curl_setopt ($ ch , CURLOPT_POSTFIELDS , $ postData );
147151 return $ this ->execute ($ ch );
@@ -157,7 +161,11 @@ public function post($url, $postData)
157161 */
158162 public function put ($ url , $ postData )
159163 {
160- $ ch = $ this ->initRequest ($ url , array ('Content-Type: application/atom+xml ' ));
164+ $ headers = array (
165+ 'Content-Type: application/atom+xml ' ,
166+ 'Content-Length: ' . strlen ($ postData ),
167+ );
168+ $ ch = $ this ->initRequest ($ url , $ headers );
161169 curl_setopt ($ ch , CURLOPT_CUSTOMREQUEST , 'PUT ' );
162170 curl_setopt ($ ch , CURLOPT_POSTFIELDS , $ postData );
163171 return $ this ->execute ($ ch );
0 commit comments