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

missing required arguments in utils.fetch #798

Merged
merged 1 commit into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion jupyter_server/serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def shutdown_server(server_info, timeout=5, log=None):
if log:
log.debug("POST request to %sapi/shutdown", url)

fetch(url, method="POST", headers={"Authorization": "token " + server_info["token"]})
fetch(url, method="POST", body=b"", headers={"Authorization": "token " + server_info["token"]})
# Poll to see if it shut down.
for _ in range(timeout * 10):
if not check_pid(pid):
Expand Down
8 changes: 6 additions & 2 deletions jupyter_server/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,9 @@ def fetch(urlstring, method="GET", body=None, headers=None):
Send a HTTP, HTTPS, or HTTP+UNIX request
to a Tornado Web Server. Returns a tornado HTTPResponse.
"""
with _request_for_tornado_client(urlstring) as request:
with _request_for_tornado_client(
urlstring, method=method, body=body, headers=headers
) as request:
response = HTTPClient(AsyncHTTPClient).fetch(request)
return response

Expand All @@ -356,7 +358,9 @@ async def async_fetch(urlstring, method="GET", body=None, headers=None, io_loop=
Send an asynchronous HTTP, HTTPS, or HTTP+UNIX request
to a Tornado Web Server. Returns a tornado HTTPResponse.
"""
with _request_for_tornado_client(urlstring) as request:
with _request_for_tornado_client(
urlstring, method=method, body=body, headers=headers
) as request:
response = await AsyncHTTPClient(io_loop).fetch(request)
return response

Expand Down