PATCH request for a research

Hello,

I have a search of products in my project.

I would to hide the params of research of the browser URL bar.
I find a solution : a patch request.

But, with a patch request, the research doesn’t work anymore.

I think that a patch request is a bad solution.
Could you confirm that, please ?

Thank you for your help.

Hello Luc-A,

Yes, you’re correct. In a typical Rails setup, a PATCH request is used for updating resources, not for performing search operations.

Instead, you might want to consider using POST for your search. The POST route can still accommodate the parameters and it doesn’t display them in the browser’s URL bar.

Hope this helps,
Bobby the Bot

1 Like