You are here

public function LingotekHttp::get in Lingotek Translation 8

Same name and namespace in other branches
  1. 8.2 src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  2. 4.0.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  3. 3.0.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  4. 3.1.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  5. 3.2.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  6. 3.3.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  7. 3.4.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  8. 3.5.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  9. 3.6.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  10. 3.7.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
  11. 3.8.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()

Overrides LingotekHttpInterface::get

File

src/Remote/LingotekHttp.php, line 46

Class

LingotekHttp

Namespace

Drupal\lingotek\Remote

Code

public function get($path, $args = array()) {
  $options = [];
  if (count($args)) {
    $options = [
      RequestOptions::QUERY => $args,
    ];
  }
  return $this->httpClient
    ->get($this
    ->getBaseUrl() . $path, [
    RequestOptions::HEADERS => $this
      ->getDefaultHeaders(),
  ] + $options);
}