src/Traits/RestApiTrait.php
protected function doPostAction($uri, array $data = [])
    {
        $this->setActionUri($uri);

        try {
            $response = $this->client->post($this->uri, ['json' => $data]);
        } catch (ClientException $e) {
            $response = $e->getResponse();
        } catch (ServerException $e) {
            $response = $e->getResponse();
        }

        return $this->responseToJson($response);
    }
protected function doPostAction($uri, array $data = [])
    {
        $this->setActionUri($uri);

        try {
            $response = $this->client->post($this->uri, ['json' => $data]);
        } catch (ClientException $e) {
            $response = $e->getResponse();
        } catch (ServerException $e) {
            $response = $e->getResponse();
        }

        return $this->responseToJson($response);
    }
Create or update a resource

@param string $uri
@param array $data
@return array