@@ -121,23 +121,6 @@ protected function post($path, array $parameters = array(), $requestHeaders = ar
121
121
return ResponseMediator::getContent ($ response );
122
122
}
123
123
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
-
141
124
/**
142
125
* @param string $path
143
126
* @param array $parameters
@@ -148,7 +131,11 @@ protected function put($path, array $parameters = array(), $requestHeaders = arr
148
131
{
149
132
$ path = $ this ->preparePath ($ path );
150
133
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
+ }
152
139
153
140
$ response = $ this ->client ->getHttpClient ()->put ($ path , $ requestHeaders , $ body );
154
141
@@ -163,11 +150,9 @@ protected function put($path, array $parameters = array(), $requestHeaders = arr
163
150
*/
164
151
protected function delete ($ path , array $ parameters = array (), $ requestHeaders = array ())
165
152
{
166
- $ path = $ this ->preparePath ($ path );
167
-
168
- $ body = empty ($ parameters ) ? null : $ this ->streamFactory ->createStream (http_build_query ($ parameters ));
153
+ $ path = $ this ->preparePath ($ path , $ parameters );
169
154
170
- $ response = $ this ->client ->getHttpClient ()->delete ($ path , $ requestHeaders, $ body );
155
+ $ response = $ this ->client ->getHttpClient ()->delete ($ path , $ requestHeaders );
171
156
172
157
return ResponseMediator::getContent ($ response );
173
158
}
0 commit comments