public function LingotekHttp::get in Lingotek Translation 3.5.x
Same name and namespace in other branches
- 8 src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 8.2 src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 4.0.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 3.0.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 3.1.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 3.2.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 3.3.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 3.4.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 3.6.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 3.7.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
- 3.8.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::get()
Send a GET request.
Parameters
string|\Psr\Http\Message\UriInterface $path: URI object or string.
array $args: Request argument to add via query string.
Return value
\Psr\Http\Message\ResponseInterface A response.
Overrides LingotekHttpInterface::get
File
- src/
Remote/ LingotekHttp.php, line 46
Class
- LingotekHttp
- Lingotek HTTP implementation using Guzzle.
Namespace
Drupal\lingotek\RemoteCode
public function get($path, $args = []) {
$options = [];
if (count($args)) {
$options = [
RequestOptions::QUERY => $args,
];
}
return $this->httpClient
->get($this
->getBaseUrl() . $path, [
RequestOptions::HEADERS => $this
->getDefaultHeaders(),
] + $options);
}