-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Paul Hallett
committed
Oct 4, 2023
1 parent
0a4a885
commit 0d88715
Showing
7 changed files
with
40 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
|
||
|
||
async def get(url: str, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP GET request """ | ||
return await client.get(parse_url(url), headers=headers) | ||
|
||
async def post(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP POST request """ | ||
return await client.post(parse_url(url), json=data, headers=headers) | ||
|
||
async def delete(url: str, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
return await client.delete(parse_url(url), headers=headers) | ||
|
||
async def put(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP PUT request """ | ||
return await client.put(parse_url(url), json=data, headers=headers) | ||
|
||
async def delete(url: str, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP DELETE request """ | ||
return await client.delete(parse_url(url), headers=headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
|
||
|
||
def get(url: str, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP GET request """ | ||
return client.get(parse_url(url), headers=headers) | ||
|
||
def post(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP POST request """ | ||
return client.post(parse_url(url), json=data, headers=headers) | ||
|
||
def put(url: str, data: dict, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP PUT request """ | ||
return client.put(parse_url(url), json=data, headers=headers) | ||
|
||
def delete(url: str, headers: typing.Optional[dict] = None) -> httpx.Response: | ||
""" Issue an HTTP DELETE request """ | ||
return client.delete(parse_url(url), headers=headers) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters