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

Allow headers to be set when querying statements #26

Closed
garemoko opened this issue Mar 2, 2015 · 2 comments
Closed

Allow headers to be set when querying statements #26

garemoko opened this issue Mar 2, 2015 · 2 comments
Assignees

Comments

@garemoko
Copy link
Contributor

garemoko commented Mar 2, 2015

It would be helpful to be able to pass options to sendRequest via queryStatements, for example headers such as Accept-language.

The code might look something like (although $options should really be optional):

    public function queryStatementsWithOptions($query, $options) {
        $requestCfg = array(
            'params' => $this->_queryStatementsRequestParams($query),
        );

        $response = $this->sendRequest('GET', 'statements', $requestCfg, $options);

        if ($response->success) {
            $this->_queryStatementsResult($response);
        }

        return $response;
    }
@garemoko
Copy link
Contributor Author

garemoko commented Mar 2, 2015

Actually, we can just add

'headers', 
'params',

to the list https://github.com/RusticiSoftware/TinCanPHP/blob/master/src/RemoteLRS.php#L334 to the same effect.

@brianjmiller
Copy link
Member

This was slipped in as part of #28 but wouldn't have worked as indicated because those two options end up one level deeper than is intended. They would have to get handled at the queryStatements level so I backed it out as part of #41.

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

No branches or pull requests

2 participants