You are here

public function SearchApiAcquiaSearchConnectionV3::makeServletRequest in Acquia Search for Search API 7.2

Makes a request to a servlet (a path) that's not a standard path.

Parameters

string $servlet: A path to be added to the base Solr path. e.g. 'extract/tika'.

array $params: Any request parameters when constructing the URL.

array $options: Options to be passed to drupal_http_request().

Return value

object The HTTP response object.

Throws

SearchApiException

Overrides SearchApiSolrConnection::makeServletRequest

File

includes/v3/SearchApiAcquiaSearchConnectionV3.php, line 13

Class

SearchApiAcquiaSearchConnectionV3
Starting point for the Solr API. Represents a Solr server resource and has methods for pinging, adding, deleting, committing, optimizing and searching.

Code

public function makeServletRequest($servlet, $params = [], $options = []) {
  $params += [
    'wt' => 'json',
  ];
  $nonce = SearchApiAcquiaCrypt::randomBytes(24);
  $url = $this
    ->constructUrl($servlet, $params);
  $this
    ->prepareRequest($url, $options, $nonce);
  $response = $this
    ->makeHttpRequest($url, $options);
  $response = $this
    ->checkResponse($response);
  return $this
    ->authenticateResponse($response, $nonce, $url);
}