Reading PUT request body.


I am working on REST API with oauth2 authorization.

For Oauth2 server i use

Php doc says here

Prior to PHP 5.6, a stream opened with php://input could only be read once; the stream did not support seek operations. However, depending on the SAPI implementation, it may be possible to open another php://input stream and restart reading. This is only possible if the request body data has been saved. Typically, this is the case for POST requests, but not other request methods, such as PUT or PROPFIND.

In short it means that it is possible to read POST body twice, but not PUT.

But Oauth2 server reads it first time here

So when i read raw body in Yii2 Request, it is empty. (only on PUT, on POST and PATCH it is ok and can be read twice).

I know that this is kind of expected, no bugs. But what would be the solution for this?