@@ -121,23 +121,6 @@ protected function post($path, array $parameters = array(), $requestHeaders = ar
121121 return ResponseMediator::getContent ($ response );
122122 }
123123
124- /**
125- * @param string $path
126- * @param array $parameters
127- * @param array $requestHeaders
128- * @return mixed
129- */
130- protected function patch ($ path , array $ parameters = array (), $ requestHeaders = array ())
131- {
132- $ path = $ this ->preparePath ($ path );
133-
134- $ body = empty ($ parameters ) ? null : $ this ->streamFactory ->createStream (http_build_query ($ parameters ));
135-
136- $ response = $ this ->client ->getHttpClient ()->patch ($ path , $ requestHeaders , $ body );
137-
138- return ResponseMediator::getContent ($ response );
139- }
140-
141124 /**
142125 * @param string $path
143126 * @param array $parameters
@@ -148,7 +131,11 @@ protected function put($path, array $parameters = array(), $requestHeaders = arr
148131 {
149132 $ path = $ this ->preparePath ($ path );
150133
151- $ body = empty ($ parameters ) ? null : $ this ->streamFactory ->createStream (http_build_query ($ parameters ));
134+ $ body = null ;
135+ if (!empty ($ parameters )) {
136+ $ body = $ this ->streamFactory ->createStream (http_build_query ($ parameters ));
137+ $ requestHeaders ['Content-Type ' ] = 'application/x-www-form-urlencoded ' ;
138+ }
152139
153140 $ response = $ this ->client ->getHttpClient ()->put ($ path , $ requestHeaders , $ body );
154141
@@ -163,11 +150,9 @@ protected function put($path, array $parameters = array(), $requestHeaders = arr
163150 */
164151 protected function delete ($ path , array $ parameters = array (), $ requestHeaders = array ())
165152 {
166- $ path = $ this ->preparePath ($ path );
167-
168- $ body = empty ($ parameters ) ? null : $ this ->streamFactory ->createStream (http_build_query ($ parameters ));
153+ $ path = $ this ->preparePath ($ path , $ parameters );
169154
170- $ response = $ this ->client ->getHttpClient ()->delete ($ path , $ requestHeaders, $ body );
155+ $ response = $ this ->client ->getHttpClient ()->delete ($ path , $ requestHeaders );
171156
172157 return ResponseMediator::getContent ($ response );
173158 }
0 commit comments