Guest User

Untitled

a guest
May 6th, 2018
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. $username = 'SITE USERNAME';
  2. $password = 'SITE PASSWORD';
  3. $url = 'SITE URL';
  4. $response = Drupal::httpClient()->get($url . "/entity/file/FILE ID?_format=json", [
  5. 'auth' => [$username, $password],
  6. 'headers' => [
  7. 'Content-Type' => 'application/json',
  8. ],
  9. ]);
  10. $json_string = (string) $response->getBody();
Add Comment
Please, Sign In to add comment