mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-20 00:11:50 +00:00
fix _parse_request_data_by_content_type
This commit is contained in:
parent
3b1ff2a004
commit
6be5ad5902
1 changed files with 8 additions and 4 deletions
|
|
@ -942,10 +942,14 @@ async def _parse_request_data_by_content_type(
|
|||
|
||||
if "application/json" in content_type:
|
||||
# ✅ Handle JSON
|
||||
body = await request.json()
|
||||
query_params_data = body.get("query_params")
|
||||
custom_body_data = body.get("custom_body")
|
||||
stream = body.get("stream")
|
||||
try:
|
||||
body = await request.json()
|
||||
query_params_data = body.get("query_params")
|
||||
custom_body_data = body.get("custom_body")
|
||||
stream = body.get("stream")
|
||||
except json.JSONDecodeError:
|
||||
# Handle requests with no body (e.g., DELETE requests)
|
||||
pass
|
||||
elif "multipart/form-data" in content_type:
|
||||
# ✅ Handle multipart form-data
|
||||
form = await request.form()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue