diff --git a/src/OpenSearch/Client.php b/src/OpenSearch/Client.php index 2fc42e8f..324afcbb 100644 --- a/src/OpenSearch/Client.php +++ b/src/OpenSearch/Client.php @@ -1617,9 +1617,7 @@ public function create(array $params = []) $index = $this->extractArgument($params, 'index'); $body = $this->extractArgument($params, 'body'); - $endpoint = $id ? - $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Create::class) - : $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Index::class); + $endpoint = $id ? $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Create::class) : $this->endpointFactory->getEndpoint(\OpenSearch\Endpoints\Index::class); $endpoint->setParams($params); $endpoint->setId($id); $endpoint->setIndex($index); @@ -1882,6 +1880,9 @@ public function setAsync(bool $isAsync): static */ public function sendRawRequest(string $method, string $uri, array $params = [], ?string $body = null): Promise|ResponseInterface { + $params = $attributes['params'] ?? []; + $body = $attributes['body'] ?? null; + $request = $this->transport->createRequest($method, $uri, $params, $body); if ($this->isAsync()) {