Last active
June 25, 2019 15:54
-
-
Save achraf-jeday/26b8a74df18b499e09f2c406eac6873c to your computer and use it in GitHub Desktop.
Drupal 8 and GuzzleHttp 6: Basic HTTP authentication.
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
$credentials = base64_encode("admin:SuperSecret123"); | |
$apiResponse = $this->client->get("{$this->container->getParameter('api')}jwt/token", | |
[ | |
'verify' => false, | |
'headers' => [ | |
'Authorization' => 'Basic ' . $credentials, | |
], | |
]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment