Skip to content

Commit aa2be5f

Browse files
Post request options changed to form_params (#315)
Co-authored-by: Ben Giamarino <[email protected]>
1 parent 8e0687a commit aa2be5f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/code/Meta/BusinessExtension/Helper/GraphAPIAdapter.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ private function callApi($method, $endpoint, $request)
153153
}
154154
// TODO: repalce with admin user local
155155
$request['locale'] = 'en_US';
156-
$response = $this->client->request($method, $endpoint, ['query' => $request]);
156+
157+
// post request form_params should be used as it adds data in body rather than keeping it in URL
158+
$option = $method === 'POST' ? 'form_params' : 'query';
159+
$response = $this->client->request($method, $endpoint, [$option => $request]);
157160
if ($this->debugMode) {
158161
$this->logger->debug(json_encode([
159162
'response' => [

0 commit comments

Comments
 (0)