adjust post body for new guzzle

Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
Robin Appelman 2018-02-09 17:11:59 +01:00
parent 359ccbc023
commit fe23bb5916
No known key found for this signature in database
GPG Key ID: 42B69D8A64526EFB
1 changed files with 4 additions and 0 deletions

View File

@ -224,6 +224,10 @@ class Client implements IClient {
*/
public function post(string $uri, array $options = []): IResponse {
$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()));
return new Response($response);
}