Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get method does not have possibility to pass query arguments. #200

Open
ghost opened this issue Oct 30, 2017 · 1 comment
Open

get method does not have possibility to pass query arguments. #200

ghost opened this issue Oct 30, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Oct 30, 2017

Hello.

At the moment when using get method, there is no possibility to pass custom query arguments.
Example: ( This wont work ):

$photos = $facebook->get(
    '/' . $album['id'] . '/photos?id,album,height,images,link,name,width',
    $accessToken
)->getDecodedBody();

And if we look into code:

    public function get($endpoint, $accessToken = null, $eTag = null, $graphVersion = null)
    {
        return $this->sendRequest(
            'GET',
            $endpoint,
            $params = [],
            $accessToken,
            $eTag,
            $graphVersion
        );
    }

Looks like $params variable is hardcoded. And it won't accept custom columns.

@ghost
Copy link
Author

ghost commented Oct 30, 2017

UPDATE:*

There is possibility to do request like this:

            $fields = [
                'fields' => 'id,album,height,images,link,name,width',
            ];

            $photos = $facebook->sendRequest('GET', '/' . $album['id'] . '/photos', $fields, $accessToken)
                ->getDecodedBody();

Still, I think that GET request should have option to send custom fields to be returned with request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants