Last active
July 27, 2020 05:06
-
-
Save thelebster/100bfe4b998e656642af1d8ef0234914 to your computer and use it in GitHub Desktop.
Drupal: Get status code from a HTTP HEAD request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $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