Y
Y
Yuri Matveenko2017-08-16 20:45:43
Facebook
Yuri Matveenko, 2017-08-16 20:45:43

FaceBook me/picture?type=large. How to return JSON?

https://developers.facebook.com/tools/explorer/?me...
Here is, in fact, GAE. A JSON file is returned there, but if you execute a request in the address bar, it will redirect to the image.
The difficulty is this

$photo=file_get_contents('https://graph.facebook.com/me/picture?access_token='.$token.'&type=large');

Doodles come, as I understand the picture itself.
How to get a JSON file or just a link to this image

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Philipp, 2017-08-17
@zoonman

To return JSON, you need to pass the redirect parameter set to false .

$request = new FacebookRequest(
  $session,
  'GET',
  '/me/picture',
  array(
    'type' => 'large',
    'redirect' => 'false'
  )
);

$response = $request->execute();
$graphObject = $response->getGraphObject();
/* handle the result */

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question