[Python] How to create a FastAPI endpoint that can accept either File/Form or JSON body?

Discussão em 'Python' iniciado por Stack, Dezembro 31, 2024.

  1. Stack

    Stack Membro Participativo

    I would like to create an endpoint in FastAPI that might receive either multipart/form-data or JSON body. Is there a way I can make such an endpoint accept either, or detect which type of data is receiving?

    Continue reading...

Compartilhe esta Página