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“…

Yes! This worked, thank you so much!