How to Access Parameters in the Body of POST Request in Controller

Hello,
I built an API endpoint via controller that accepts POST requests. Here is my code:

I solved it, I could access request’s body by:
$parameters = json_decode($request->getContent(), true);

Hi, I could you perhaps share the full code of your example?
I am trying to access post data in my custom subscriber, but no success.
newUnitPrice = _GET[„newUnitPrice“]
outputs „undefined index: newUnitPrice“…

@thomas.hoffmann I think there is a difference in how you get it from a controller and when using a subscriber. In a subscriber, you extract it, using the RequestStack class, that you inject there. There is an example for this on my blog: How to access POST and GET parameters in Shopware 6 - Shopwarian.com

Yes! This worked, thank you so much!