Skip to content

Commit

Permalink
fix: Use data instead of params for requests.post
Browse files Browse the repository at this point in the history
  • Loading branch information
achillesrasquinha committed Feb 10, 2019
1 parent 8cbb567 commit 4d4ea13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pipupgrade/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,13 +303,13 @@ def command(
raise ValueError(errstr % ("GitHub Username", "--github-username", getenvvar("GITHUB_USERNAME")))

url = "/".join(["https://api.github.com", "repos", github_username, github_reponame, "pulls"])
params = dict(
data = dict(
head = "%s:branch" % git_username,
base = target_branch,
title = title,
body = body
)
response = req.post(url, params = params)
response = req.post(url, data = data)

if response.ok:
print("OK")
Expand Down
2 changes: 1 addition & 1 deletion src/pipupgrade/request/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def post(*args, **kwargs):
return req.post(*args, **kwargs)
except ImportError:
url = kwargs.get("url")
params = kwargs.get("params", { })
params = kwargs.get("data", { })

response = Response()

Expand Down

0 comments on commit 4d4ea13

Please sign in to comment.