You are here

public function AcquiaSearchService::makeServletRequest in Acquia Connector 7.2

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

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

@override

Overrides DrupalApacheSolrService::makeServletRequest

File

acquia_search/Acquia_Search_Service.php, line 81

Class

AcquiaSearchService
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 = 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);
}