Skip to content

Commit 43b795b

Browse files
Update Client.php (#323)
Add the possibility to send a format array of data to JSON with Guzzle (https://docs.guzzlephp.org/en/stable/request-options.html#json
1 parent 214519c commit 43b795b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/Omniphx/Forrest/Client.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,12 @@ private function handleRequest()
226226
} else {
227227
unset($this->parameters['query']);
228228
}
229+
230+
if (isset($this->options['json'])) {
231+
$this->parameters['json'] = $this->options['json'];
232+
} else {
233+
unset($this->parameters['json']);
234+
}
229235

230236
try {
231237
$response = $this->httpClient->request($this->options['method'], $this->url, $this->parameters);

0 commit comments

Comments
 (0)