Skip to content

[LiveComponent] Force POST method when model is changed #1208

Closed
@hepisec

Description

@hepisec

Hello,

I've built my first LiveComponent and it works well. But I've noticed that backend requests are sent as GET with all props being appended as URL parameters. As my component includes sensitive data, I want to change the request method to POST. According to the code this could be achieved by adding an action (see

). But when I tried to add an data-action="live#update" attribute to my form element, I got the following error:

Error: Since LiveComponents 2.3, you no longer need data-action="live#update" on form elements. Found on element: <select data-model="mySelect" data-action="live#update">

What's the correct way to force POST for backend requests?

    <select data-model="mySelect">
        <!-- options...  should be sent as POST requests on change -->
    </select>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions