Search code examples
shopwareshopware6shopware6-app

How to access request data in Shopware 6 custom endpoint?


I want to access data sent via POST to a custom endpoint for app script. The request service doesn't seem to contain any.

For

{% do debug.dump(request) %}

i get

array:1 [▼
  0 => null
]

Is there a way to access data sent with the request to a custom endpoint for app script ?


Solution

  • You should access the request over the hook variable:

    {% do debug.dump(hook.request) %}
    

    Refer to the reference of all the script hooks to see what data is available under the hook variable.