Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $username = 'SITE USERNAME';
- $password = 'SITE PASSWORD';
- $url = 'SITE URL';
- $response = Drupal::httpClient()->get($url . "/entity/file/FILE ID?_format=json", [
- 'auth' => [$username, $password],
- 'headers' => [
- 'Content-Type' => 'application/json',
- ],
- ]);
- $json_string = (string) $response->getBody();
Add Comment
Please, Sign In to add comment