Skip to content

Commit

Permalink
fix: let GET requests contain data in param rather than body (#2661)
Browse files Browse the repository at this point in the history
  • Loading branch information
fregataa authored Aug 6, 2024
1 parent 7a87f1b commit 17557a2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions changes/2661.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Let `GET /resource/usage/period` request contain data in query parameter rather than JSON body.
15 changes: 9 additions & 6 deletions src/ai/backend/client/func/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,15 @@ async def usage_per_period(cls, group_id: str, start_date: str, end_date: str):
:param end_date: end date in string format (yyyymmdd).
:param group_id: Groups ID to list usage statistics.
"""
rqst = Request("GET", "/resource/usage/period")
rqst.set_json({
"group_id": group_id,
"start_date": start_date,
"end_date": end_date,
})
rqst = Request(
"GET",
"/resource/usage/period",
params={
"group_id": group_id,
"start_date": start_date,
"end_date": end_date,
},
)
async with rqst.fetch() as resp:
return await resp.json()

Expand Down

0 comments on commit 17557a2

Please sign in to comment.