You are here

public function AcquiaSearchService::makeServletRequest in Acquia Connector 7.3

Same name and namespace in other branches
  1. 7 acquia_search/Acquia_Search_Service.php \AcquiaSearchService::makeServletRequest()
  2. 7.2 acquia_search/Acquia_Search_Service.php \AcquiaSearchService::makeServletRequest()

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

@thows Exception

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: @see drupal_http_request() $options.

Return value

response object

Overrides DrupalApacheSolrService::makeServletRequest

File

acquia_search/Acquia_Search_Service.php, line 71

Class

AcquiaSearchService
Starting point for the Solr API.

Code

public function makeServletRequest($servlet, $params = array(), $options = array()) {

  // Add default params.
  $params += array(
    'wt' => 'json',
  );
  $url = $this
    ->_constructUrl($servlet, $params);

  // We assume we only authenticate the URL for other servlets.
  $nonce = $this
    ->prepareRequest($url, $options, FALSE);
  $response = $this
    ->_makeHttpRequest($url, $options);
  $response = $this
    ->checkResponse($response);
  return $this
    ->authenticateResponse($response, $nonce, $url);
}