You are here

protected function SearchApiSolrConnection::sendRawPost in Search API Solr 7

Sends a PUT request to the Solr server.

Parameters

string $url: The URL to which the request should be sent.

array $options: Additional options for the request, as recognized by drupal_http_request().

Return value

object The HTTP response, as returned by drupal_http_request().

Throws

SearchApiException If an error occurs, either during sending or on the server side.

2 calls to SearchApiSolrConnection::sendRawPost()
SearchApiSolrConnection::search in includes/solr_connection.inc
Executes a search on the Solr server.
SearchApiSolrConnection::update in includes/solr_connection.inc
Sends a raw update request to the Solr server.

File

includes/solr_connection.inc, line 605

Class

SearchApiSolrConnection
Represents a Solr server resource.

Code

protected function sendRawPost($url, array $options = array()) {
  $options['method'] = 'POST';

  // Normally we use POST to send XML documents.
  if (empty($options['headers']['Content-Type'])) {
    $options['headers']['Content-Type'] = 'text/xml; charset=UTF-8';
  }
  $response = $this
    ->makeHttpRequest($url, $options);
  return $this
    ->checkResponse($response);
}