From 9fdc074820a8d41cdb2224b37c4cc4600a3f571a Mon Sep 17 00:00:00 2001 From: Hugh Ramsden Date: Wed, 4 Sep 2024 14:01:03 +0100 Subject: [PATCH] Improved doc string --- pytest_jupyter/jupyter_server.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pytest_jupyter/jupyter_server.py b/pytest_jupyter/jupyter_server.py index be9bd26..339b0c2 100644 --- a/pytest_jupyter/jupyter_server.py +++ b/pytest_jupyter/jupyter_server.py @@ -268,6 +268,23 @@ def jp_fetch(jp_serverapp, http_server_client, jp_auth_header, jp_base_url): async def my_test(jp_fetch): response = await jp_fetch("api", "spec.yaml") ... + + With query parameters: + + .. code-block:: python + + async def my_test(jp_fetch): + response = await jp_fetch("api", "spec.yaml", params={'parameter': 'value'}) + ... + + A POST request with data: + + .. code-block:: python + + async def my_test(jp_fetch): + response = await jp_fetch("api", "spec.yaml", body=json.dumps({'parameter': 'value'}), method='POST') + ... + """ def client_fetch(*parts, headers=None, params=None, **kwargs):