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

use post when jql in params #548

Closed
wants to merge 2 commits into from
Closed
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: 4 additions & 1 deletion jira/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2526,7 +2526,10 @@ def _get_url(self, path, base=JIRA_BASE_URL):

def _get_json(self, path, params=None, base=JIRA_BASE_URL):
url = self._get_url(path, base)
r = self._session.get(url, params=params)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should be conditionally switching from get to post here like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@264768502 : Is there any reason not to just POST all the time?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get jql from filter first, them try to use jql to do issue search
JIRA server feedback input parameter with invalid string.
After switch to use post, search success.
But it has a little strange, after I switch another os, issue go. I have no idea why, maybe use different requests.

My commit maybe not best resolution.
As you know, http url has length limitation
and 'get' need encode parameter to url, this will involve some unknown issue.

how about add parameter to let user control use post or get?
In my opinion, check url will give a little hard to maintain

@asqui I don't want change original design too much
Only switch to post when search issue.

if params and 'jql' in params:
r = self._session.post(url, json=params)
else:
r = self._session.get(url, params=params)
try:
r_json = json_loads(r)
except ValueError as e:
Expand Down