protected function post(string $path, array $params = [], array $headers = [])
    {
        $body = self::createJsonBody($params);

        if ($body) {
            $headers = self::addJsonContentType($headers);
        }

        return $this->postRaw($path, $body, $headers);
    }
protected function post(string $path, array $params = [], array $headers = [])
    {
        $body = self::createJsonBody($params);

        if ($body) {
            $headers = self::addJsonContentType($headers);
        }

        return $this->postRaw($path, $body, $headers);
    }
protected function post ( string $ path , array $ params = [ ] , array $ headers = [ ] ) { $ body = self :: createJsonBody ( $ params ) ; if ( $ body ) { $ headers = self :: addJsonContentType ( $ headers ) ; } return $ this -> postRaw ( $ path , $ body , $ headers ) ; }
Send a POST request with JSON-encoded params.

@param string $path
@param array  $params
@param array  $headers

@throws \Http\Client\Exception

@return array
Send a POST request with JSON - encoded params .