public function LingotekHttp::delete in Lingotek Translation 3.3.x
Same name and namespace in other branches
- 8 src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 8.2 src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 4.0.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 3.0.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 3.1.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 3.2.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 3.4.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 3.5.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 3.6.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 3.7.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
- 3.8.x src/Remote/LingotekHttp.php \Drupal\lingotek\Remote\LingotekHttp::delete()
Send a DELETE 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::delete
File
- src/
Remote/ LingotekHttp.php, line 90
Class
- LingotekHttp
- Lingotek HTTP implementation using Guzzle.
Namespace
Drupal\lingotek\RemoteCode
public function delete($path, $args = []) {
// Let the post method masquerade as a DELETE
$options = [];
if (count($args)) {
$options = [
RequestOptions::QUERY => $args,
];
}
return $this->httpClient
->delete($this
->getBaseUrl() . $path, [
RequestOptions::HEADERS => $this
->getDefaultHeaders() + [
'X-HTTP-Method-Override' => 'DELETE',
],
] + $options);
}