flask-restx icon indicating copy to clipboard operation
flask-restx copied to clipboard

Unable to send data as form-data

Open shukranjs opened this issue 2 years ago • 3 comments

I want to send data in formData in swagger but it returns None. However, it displays that it is multipart/form-data but returns None

shukranjs avatar Jun 06 '23 07:06 shukranjs

wondering if you can share the code. Meanwhile try as per the README.md or something like,

@api.doc("create_todo")
@api.expect(todo)
@api.marshal_with(todo, code=201)
def post(self):
    """Create a new task"""
    return DAO.create(api.payload), 201

as both seem to send data as form in swagger

Keep posted how that goes. :-)

thefunkinator avatar Jul 07 '23 03:07 thefunkinator

How to upload file using this structrue?

On Fri, Jul 7, 2023, 07:39 :-) @.***> wrote:

wondering if you can share the code. Meanwhile try as per the README.md https://github.com/chipndell/flask-restx#quick-start or something like,

@api.doc("create_todo") @api.expect(todo) @api.marshal_with(todo, code=201) def post(self): """Create a new task""" return DAO.create(api.payload), 201

as both seem to send data as form in swagger

Keep posted how that goes. :-)

— Reply to this email directly, view it on GitHub https://github.com/python-restx/flask-restx/issues/546#issuecomment-1624621510, or unsubscribe https://github.com/notifications/unsubscribe-auth/APO5GPRCD5MZVCEJTV22WPDXO6AHDANCNFSM6AAAAAAY36TH6M . You are receiving this because you authored the thread.Message ID: @.***>

shukranjs avatar Jul 07 '23 05:07 shukranjs

Here is Link to Doc for that.

thefunkinator avatar Jul 07 '23 18:07 thefunkinator