Skip to content

Commit 49e926d

Browse files
authored
missing required arguments in utils.fetch (#798)
1 parent ef1deca commit 49e926d

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

jupyter_server/serverapp.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ def shutdown_server(server_info, timeout=5, log=None):
493493
if log:
494494
log.debug("POST request to %sapi/shutdown", url)
495495

496-
fetch(url, method="POST", headers={"Authorization": "token " + server_info["token"]})
496+
fetch(url, method="POST", body=b"", headers={"Authorization": "token " + server_info["token"]})
497497
# Poll to see if it shut down.
498498
for _ in range(timeout * 10):
499499
if not check_pid(pid):

jupyter_server/utils.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@ def fetch(urlstring, method="GET", body=None, headers=None):
346346
Send a HTTP, HTTPS, or HTTP+UNIX request
347347
to a Tornado Web Server. Returns a tornado HTTPResponse.
348348
"""
349-
with _request_for_tornado_client(urlstring) as request:
349+
with _request_for_tornado_client(
350+
urlstring, method=method, body=body, headers=headers
351+
) as request:
350352
response = HTTPClient(AsyncHTTPClient).fetch(request)
351353
return response
352354

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

0 commit comments

Comments
 (0)