Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pysnow/oauth_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,13 @@ def _legacy_request(self, *args, **kwargs):
"You must set_token() before creating a legacy request with OAuthClient"
)

def resource(self, api_path=None, base_path="/api/now", chunk_size=None):
def resource(self, api_path=None, base_path="/api/now", chunk_size=None, **kwargs):
"""Overrides :meth:`resource` provided by :class:`pysnow.Client` with extras for OAuth

:param api_path: Path to the API to operate on
:param base_path: (optional) Base path override
:param chunk_size: Response stream parser chunk size (in bytes)
:param **kwargs: Pass request.request parameters to the Resource object
:return:
- :class:`Resource` object
:raises:
Expand All @@ -130,7 +131,7 @@ def resource(self, api_path=None, base_path="/api/now", chunk_size=None):

if isinstance(self.token, dict):
self.session = self._get_oauth_session()
return super(OAuthClient, self).resource(api_path, base_path, chunk_size)
return super(OAuthClient, self).resource(api_path, base_path, chunk_size, **kwargs)

raise MissingToken(
"You must set_token() before creating a resource with OAuthClient"
Expand Down