Skip to content

Instantly share code, notes, and snippets.

@thelebster
Last active July 27, 2020 05:06
Show Gist options
  • Select an option

  • Save thelebster/100bfe4b998e656642af1d8ef0234914 to your computer and use it in GitHub Desktop.

Select an option

Save thelebster/100bfe4b998e656642af1d8ef0234914 to your computer and use it in GitHub Desktop.
Drupal: Get status code from a HTTP HEAD request
$status_code = (string) \Drupal::httpClient()->head($uri, ['http_errors' => false])->getStatusCode();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment