You are here

protected function SearchApiAcquiaSearchConnectionV3::prepareRequest in Acquia Search for Search API 7.2

Prepares request before send.

Parameters

string $url: Request URL.

array $options: Request options.

string $nonce: Nonce.

Throws

\Exception

3 calls to SearchApiAcquiaSearchConnectionV3::prepareRequest()
SearchApiAcquiaSearchConnectionV3::makeServletRequest in includes/v3/SearchApiAcquiaSearchConnectionV3.php
Makes a request to a servlet (a path) that's not a standard path.
SearchApiAcquiaSearchConnectionV3::sendRawGet in includes/v3/SearchApiAcquiaSearchConnectionV3.php
Sends a GET request to the Solr server.
SearchApiAcquiaSearchConnectionV3::sendRawPost in includes/v3/SearchApiAcquiaSearchConnectionV3.php
Sends a PUT request to the Solr server.

File

includes/v3/SearchApiAcquiaSearchConnectionV3.php, line 70

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

protected function prepareRequest(&$url, array &$options, $nonce) {
  $url = $this
    ->adjustUrl($url);
  if (!isset($options['headers'])) {
    $options['headers'] = [];
  }
  $string = !empty($options['data']) ? $options['data'] : NULL;
  $options['headers']['Cookie'] = $this
    ->createAuthCookie($url, $nonce, $string);
  $options['headers'] += $this
    ->addUserAgentHeader();
}