Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to POST file and json payload at the same time? #380

Closed
kettenbach-it opened this issue Jul 29, 2022 · 2 comments
Closed

How to POST file and json payload at the same time? #380

kettenbach-it opened this issue Jul 29, 2022 · 2 comments

Comments

@kettenbach-it
Copy link

This does not work:

    @HelperBlp.arguments(CodescannerDataSchema, location="json")
    @HelperBlp.arguments(MultipartFileSchema, location='files')

and I don't want to send the json-data as query-parameter (ugly).
How can this be done?

@reederz
Copy link

reederz commented Jul 30, 2022

You can stack multiple locations https://webargs.readthedocs.io/en/latest/advanced.html#mixing-locations :

@HelperBlp.arguments(CodescannerDataSchema, location="json")
@HelperBlp.arguments(MultipartFileSchema, location='files')
def route(json_args, files_args):
    pass

@kettenbach-it
Copy link
Author

I think this is covered in #46

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants