You are here

public function SolrConnectorPluginBase::coreRestPost in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::coreRestPost()
  2. 8 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::coreRestPost()
  3. 8.2 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::coreRestPost()

Sends a REST POST request to the Solr core and returns the result.

Parameters

string $path: The path to append to the base URI.

string $command_json: The command to send encoded as JSON.

\Solarium\Core\Client\Endpoint|null $endpoint:

Return value

string The decoded response.

Throws

\Drupal\search_api_solr\SearchApiSolrException

Overrides SolrConnectorInterface::coreRestPost

1 method overrides SolrConnectorPluginBase::coreRestPost()
Solr36Connector::coreRestPost in modules/search_api_solr_legacy/src/Plugin/SolrConnector/Solr36Connector.php
Sends a REST POST request to the Solr core and returns the result.

File

src/SolrConnector/SolrConnectorPluginBase.php, line 704

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

public function coreRestPost($path, $command_json = '', ?Endpoint $endpoint = NULL) {
  $this
    ->useTimeout(self::INDEX_TIMEOUT);
  return $this
    ->restRequest($this->configuration['core'] . '/' . ltrim($path, '/'), Request::METHOD_POST, $command_json, $endpoint);
}