Change GET request to POST requests #2732
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
GET requests should not have http body according to RFC.
Works well with POST here, and fails with GET for some cases:
2019-03-22 20:51:24,589 tornado.application[19] ERROR: Uncaught exception GET /api/add_task ...
Traceback (most recent call last):
File "contrib/python/tornado/tornado/web.py", line 1510, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "contrib/python/luigi/luigi/server.py", line 120, in get
result = getattr(self._scheduler, method)(**arguments)
File "contrib/python/luigi/luigi/scheduler.py", line 819, in add_task
assert worker is not None
AssertionError
By the way: urllib fetcher uses POST here (urlopen(full_url, body, timeout).)
Description
Motivation and Context
Have you tested this? If so, how?
I ran my jobs with this code and it works for me.