Skip to content

Multipart Body configuration on actions #1494

Discussion options

You must be logged in to vote

@nicholas-coker We did a FastAPI middleware, here's how we have implemented.

from pathlib import Path
from fastapi import Body

@app.post("/upload/")
def upload(upload_body=Body()):
    username = upload_body.get("username")
    file_path = upload_body.get("path")
    path_obj = Path(file_path)
    ....

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by AashishDhakal
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
support request request for free support. Check out our support policy
2 participants