falcon icon indicating copy to clipboard operation
falcon copied to clipboard

Add new method `req.get_param_as_media()`

Open vytas7 opened this issue 2 months ago • 8 comments

Add new method req.get_param_as_media() (or req.get_param_as_content() more in line with OpenAPI spec, but I think get_param_as_media() is more consistent with the rest of the framework).

This new method would be similar to req.get_param_as_json(), however it would also accept a content_type (str) argument instead of just defaulting to JSON.

req.get_param_as_json() could then become a thin wrapper around the new method.

TBD whether the content_type argument would be required, or could be None, and default to the application's default content type.

vytas7 avatar Oct 10 '25 18:10 vytas7

Hey, I'm new to git and would like to help solve this issue.

Can I be assigned?

NicoTinhas avatar Oct 10 '25 19:10 NicoTinhas

Hi @NicoTinhas, sure! We don't assign per se, your comment here is enough to let us and others know you're working on this.

How new are you to Python etc? I you want a gentle start we also have #2547 which is even easier 🙂

vytas7 avatar Oct 10 '25 19:10 vytas7

I don't mind,

I'll give this issue a shot and if it seems too confusing I'll comment on the other one. 🙏🏼

NicoTinhas avatar Oct 10 '25 21:10 NicoTinhas

Hey, finished the task.. hope it is good - it was quite hard for my level but still tried continuing while learning. Thanks in advance!

NicoTinhas avatar Oct 15 '25 16:10 NicoTinhas

We are looking for new contributors for this issue! :shipit:

vytas7 avatar Oct 15 '25 18:10 vytas7

TBD whether the content_type argument would be required, or could be None, and default to the application's default content type.

in https://github.com/falconry/falcon/pull/2548 the implementation made it optional falling back to the default content type, so I think we should do the same for this one

CaselIT avatar Oct 15 '25 19:10 CaselIT

hey @vytas7 I have worked on get_query_string_as_media which is currently in review. I can take this one as well. mind if I give it a try?

MannXo avatar Oct 20 '25 12:10 MannXo

Sure, go ahead @MannXo!

vytas7 avatar Oct 20 '25 16:10 vytas7