adjust post body for new guzzle
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
359ccbc023
commit
fe23bb5916
|
@ -224,6 +224,10 @@ class Client implements IClient {
|
||||||
*/
|
*/
|
||||||
public function post(string $uri, array $options = []): IResponse {
|
public function post(string $uri, array $options = []): IResponse {
|
||||||
$this->setDefaultOptions();
|
$this->setDefaultOptions();
|
||||||
|
if (isset($options['body']) && is_array($options['body'])) {
|
||||||
|
$options['form_params'] = $options['body'];
|
||||||
|
unset($options['body']);
|
||||||
|
}
|
||||||
$response = $this->client->request('post', $uri, array_merge($options, $this->getRequestOptions()));
|
$response = $this->client->request('post', $uri, array_merge($options, $this->getRequestOptions()));
|
||||||
return new Response($response);
|
return new Response($response);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue